It's all about the answers!

Ask a question

Set the attribute value based on the work item state

Ricky Jay (28626) | asked Nov 02 '16, 11:43 a.m.

We created a custom attribute in the Defect work item and we want this attribute to be updated every time a defect state is changed. 

How can we achieved this? is their any pre condition we can apply to automatically update the custom attribute field. 

Suggestions are most welcome. 

One answer

permanent link
Ralph Schoon (62.3k33643) | answered Nov 02 '16, 12:11 p.m.
No, there is no out of the box precondition for this. It is not possible to do this with preconditions as the API interface assumes that a precondition does not modify the triggering element it works on.

You can create a follow up action or participant to do this. It can detect state changes and force an additional save operation. See examples here:

Theoretically you could probably use a JavaScript based value provider, however it is so hard to detect a state change there, that you would need additional hidden attributes and I would not suggest this path.

To learn about extending follow the suggested links in the posts

Your answer

Register or to post your answer.