Devops custom rule to increment a field

Viewed 671

In DevOps, I need a field which can be a counter and get incremented +1 whenever the work item state change from "Done" to "In progress". I tried to have an integer field and set the Rule as mentioned below condition: when a work item state changes From "Done" to "In Progress" Action: Set the value of "Field" to "+1".

enter image description here

This rule is changing the value of the counter from 0 to 1 for the very first time only. However the counter does not keep incrementing whenever I change the work Item state from "Done" to "In progress"

Please suggest me an approach to do it.

2 Answers

I have a similar use case: counting the amount of times a work item fails testing (gets moved back from Resolved to Active). Since I don't need a true increment, just want an indication whether this has happened once, twice, thrice or more, I made a couple of rules, one for each increment, like this:

Rule to increment counter from 1 to 2

It won't help in any increment scenario, but possibly it helps some people.

Azure Devops does not support increments. You can try to use:

  1. TFS Aggregator (Web Service).
  2. Create rules with Azure Logic App. It contains triggers and methods to update work items.
  3. Create a custom application. Add field like "Need Increment" with default value "false". Create Rule - condition: when a work item state changes From "Done" to "In Progress" Action: Set the value of "Need Increment" to "true". Your custom application updates you increment field and set "Need Increment" to "false".
Related