Azure / Azure/azure-devops-cli-extension
[Feature Request] Add option to bypass rules on workitem create and update
- Dominant language
- Python
- Stars
- 682
- Forks
- 278
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 3
Description
**Is your feature request related to a problem? Please describe.**
I cannot bypass rules when I create or update a workitem
**Describe the solution you'd like**
The Azure DevOps REST API for [creating](https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/workitems/create) and [updating](https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/workitems/update) a workitem exposes a query parameter called "bypassRules". This defaults to `false`, but could be set to `true` to allow to bypass the rules.
I propose adding a flag `--bypass-rules` to `az boards work-item create` and `az boards work-item update` to expose this behavior in the CLI
As such the below commands will create and update a workitem respectively, setting the `System.ChangedDate` to Jan 1st 2010
```
az boards work-item create --title "Test" --type Task --fields System.ChangedDate=2010-01-01T00:00:00.000Z --bypass-rules
az boards work-item update --id --fields System.ChangedDate=2010-01-01T00:00:00.000Z --bypass-rules
```
Omitting the `--bypass-rules` flag preserves the original behavior, i.e the values in `System.ChangedDate` will be disregarded by the server and the `System.ChangedDate` will be set to the current time.
```
az boards work-item create --title "Test" --type Task --fields System.ChangedDate=2010-01-01T00:00:00.000Z
az boards work-item update --id --fields System.ChangedDate=2010-01-01T00:00:00.000Z
```
**Additional context**
An example of when this would be useful is when importing workitems from another product and history is to be preserved. Then the fields `System.CreatedDate` and `System.ChangedDate` must be set to the original creation/change dates of the workitem and not to the time when the import is run.
Contributor guide
Assessment
This issue has not been assessed yet.