Search code examples
azure-devopsworkflowazure-workflow-automation

AzureDevOps- Work item rule which only allows the work item state to progress if there is a specific work item linked


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.


Solution

  • 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.