It's all about the answers!

Ask a question

How can I create a field with number of time a work item is "rejected' - Rational Team Concert


Rodrigo Mattos (133) | asked Sep 11 '14, 6:03 p.m.
I created a custom work item called demand.
This work Item have a custom workflow (demandWorkflow)

I want the field "Reject count" to display the number of times the work item is changed to the status of Rejected
(One demand can be rejected over and over again and change back to reopen), it was requested to have a field that counts how many times the work item was rejected.

Thanks in advance.

2 answers



permanent link
Donald Nong (14.5k614) | answered Sep 11 '14, 8:57 p.m.
You may consider attribute customization with a calculated value, something similar to this post.
https://jazz.net/forum/questions/89093/calculated-value-script-error-in-rtc-error-invoking-value-provider
Some more reading on this topic.
https://jazz.net/library/article/1003
https://jazz.net/wiki/bin/view/Main/AttributeCustomization
https://jazz.net/library/article/1360

Comments
sam detweiler commented Sep 11 '14, 9:07 p.m.

Unfortunately you can't do this in a scripts because scripts cannot get the prior state. And I don't think they can get the action either. 


permanent link
Rodrigo Mattos (133) | answered Sep 12 '14, 12:53 p.m.
I can't have a check for the state?
if state.value == "rejected"
    count++
I don't care for the previous state, neither if the next stage will be reopen or close, I just want to count how many times the work item is rejected by user.

Thanks for the reply anyway, any help is appreciated

Comments
sam detweiler commented Sep 12 '14, 12:58 p.m. | edited Sep 12 '14, 12:59 p.m.

If rejected is a state, if they change the workitem (owner, comment, description, approvals, ... anything other than a NEW state) WHILE it is in that state, then your counter will be increased incorrectly..   (been there already!

the script fires on every save

it was easy to do in Java.. but you have to put something on the server disk and restart the server..

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.