How can I modify the state a work item is changed to after PR?

3.4k Views Asked by At

When we create a pull request and link a work item, after the PR is completed the status of the work items are automatically changed to "invalid". How can we change that behavior to a different status?

2

There are 2 best solutions below

3
On

In a recent update to Azure DevOps, you can now customize work item state when pull request is merged.

When you create a PR, in the description, you can set the state value of the linked work items. You must follow the specific syntax.

{state value}: #ID When you merge the PR, the system reads through the description and updates the work item state accordingly. In the follow example we set work items #300 and #301 to Resolved, #323 and #324 to Closed.

enter image description here

2
On

The Set work item state in pull request feature is also works for custom states. Here is my sample:

  1. Add a custom state to task. enter image description here

  2. Create a new pull request and add the Description like:

    Ready for QA: #id

enter image description here

  1. Create pull request and complete the merge. Do not check "Complete linked work items after merging" option.

enter image description here

  1. Now, the status of my task has been updated to Ready for QA.

enter image description here

In addition, the product group is still improving this feature. If you have any concern or suggestions, you can share it in this suggestion ticket and this one.