defect reopen count using dojo scripting calculated value
Hi, the following is the DOJO script to calculate the defect reopen counter, basically when ever the defect fails during testing it will be reopened, and the counter should increment by 1. Dont have a clue why the counter is incrementing twice when the defect is reopened, any idea appreciated. so this script gets executed whenever the status is changed.
|
Accepted answer
Ralph Schoon (63.6k●3●36●46)
| answered Jan 26 '17, 10:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jan 26 '17, 11:03 a.m. Read the documentation: https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Calculated_values
As far as I can tell, the script can be called multiple times, especially if you have more dependencies. I don't know why Eclipse and Web UI are different, but I am not convinced that they have to be working the same.
Script-based calculated valuesNote: You can find general information about script-based attribute customization in the Using scripts for attribute customization section.If you configure a Script-based calculated value, the script will be executed in three cases:
This has been discussed at length here in the forum, you can not reliably detect a state change with a calculated value, without storing some state information in some hidden attribute. You can see what state you are in, not more. You don't see that it was a change, you don't have the state before.The access to the workflow action is only available in conditions - as mentioned in the documentation above.
demo demo selected this answer as the correct answer
Comments
demo demo
commented Jan 29 '17, 1:14 a.m.
thanks Ralph, your input guided me to the right point. All i did is removed the Status from dependency on the defectopencounter attribute. Now web and eclipse client are working as expected. thanks a lot.
|
One other answer
Hi, how was the final version of your script?? I'm getting the same problem, but worst cause everytime I just refresh the wepage it increments on 3 without changing state or attribute, just refreshing.
|
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.
Comments
also noticed its working correctly in web interface, however on eclipse client the value is incremented by 2.