Count WI entries to specific state by Calculated Value
![](http://jazz.net/_images/myphoto/b6c17d01782e5079467c5bf5a08d72ab.jpg)
Hi,
I would like to create a field calld Counter and display the number of times this work item has entered specific state.
Could any one assist with the syntax of the javascript to implement this?
It should act as following:
If (new_state="something") set Counter to Counter+1.
Thanks,
Amit.
I would like to create a field calld Counter and display the number of times this work item has entered specific state.
Could any one assist with the syntax of the javascript to implement this?
It should act as following:
If (new_state="something") set Counter to Counter+1.
Thanks,
Amit.
2 answers
![](http://jazz.net/_images/myphoto/b6c17d01782e5079467c5bf5a08d72ab.jpg)
I am not sure this is going to be possible.
https://jazz.net/wiki/bin/view/Main/AttributeCustomization
mentions how to access the state, but does not mention how to distinguish between old and new state. So I think it is impossible to detect a state change. If I had to code this, I would create a precondition or a followup action, where it is possible to detect a state change.
https://jazz.net/wiki/bin/view/Main/AttributeCustomization
mentions how to access the state, but does not mention how to distinguish between old and new state. So I think it is impossible to detect a state change. If I had to code this, I would create a precondition or a followup action, where it is possible to detect a state change.