In Azure Dev Ops, in defining a customised process I have created a work item 'change request' for which I have defined a number of states, two of which are 'code review' and 'test'. The 'change request' work item will progress from 'code review' to 'test' but I would like to create a rule which only allows the 'change request' work item to move from 'code review' to 'test' if there is a 'code review' work item linked to the 'change request' work item. I have looked at creating a rule for the work item but cannot see a way to do this from the drop down options available. Has anyone been able to do something like this?

TIA

In rules for the 'code review' work item I have considered the options for when a work item state is moved from code review to test but there are no options I can see which check the linked work items apart from external/internal link count which is not specific enough.

2

There are 2 answers

2
Kim Xu-MSFT On BEST ANSWER

Currently, there's no build in feature to achieve your goal directly.

As a workaround, you could consider the below:

1.Create a custom filed in "Change Request" work item named "Check if linked"

enter image description here

2.Create a work item rule in "Change Request" work item to "make required" to define a value of the above "Check if linked" field to allow the work item state could change from "Code Review" to "Test".

enter image description here

3.When changing state, you will receive a warning message below to remind the users to check if "Code Review" work item being linked.

enter image description here

4.You need to link the "Code Review" work item, set a value for "Check if linked" field to process state change.

enter image description here

enter image description here

If you would like a direct feature to achieve your demands, try creating a suggestion here.

0
rjr-apps On

In my case, I wanted to enforce linking of Github pull requests when a certain state was set. So rather than setting a custom picklist field to remind the user to add the linked item, I simply created a custom text field where the pull request URL could be entered, and required that when the state is set.

Unfortunately ADO doesn't automatically recognize that it's a hyperlink, so I added the Clickable Links extension, and created a custom control under the text field which allows for convenient clicking of the PR hyperlink.

In the screenshot below, I created a custom group called "Pull Request", and inside it put the required text field "Pull Request URL"; and below it, the "Generated Hyperlink" custom control.

ADO screenshot