How can i retrieve the new state value of WI with script based values?
Fausto Lemos (168●1●15●18)
| asked Apr 15 '13, 4:48 p.m.
edited Apr 15 '13, 5:10 p.m. by Ralph Schoon (63.5k●3●36●46)
Using workItem.getValue(WorkItemAttributes.STATE) only shows me the current state "saved" on my WI. If i change the WI state nothing happens.. only after i save my work item. Is this then expected behavior? there is an alternative way?
|
2 answers
Ralph Schoon (63.5k●3●36●46)
| answered Apr 15 '13, 5:14 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Apr 15 '13, 5:14 p.m.
Hi Fausto,
this is as designed. Please see https://jazz.net/wiki/bin/view/Main/AttributeCustomization and https://jazz.net/library/article/1093 Lab 5 for more information. Scrips only get triggered when attributes change. You can also only have a dependency to the state attribute today if you want to know the stat changed, If you need to do something more elaborate, you need to create an advisor. Start here if you want to go that route. Comments
Fausto Lemos
commented Apr 15 '13, 7:51 p.m.
Hi Ralph,
i agree when you say that scripts only get triggered when attributes change. But why i always get the actual state saved at my WI??
Example: i have a "foo" field that has "state" field as a dependency.
My "foo" field has a "script based filtered value set". Inside this script, i call a webservice based on WI state. But so far, when i change WI state and then click at my value set picker, the old state (actual state persisted at server side) is considered instead of the new value.
Do you have a clue?
1
Hi Fausto,
I looked into the API used for attribute customization for http://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/, I am not even sure the state change can be detected with the available API.
|
Hi, Ralph,
could you confirm that whether the "Java Based Value Provider" API of RTC is able to detect the state change of WI?
Comments The Java API has pretty much the same input data the JavaScript has. From the input only conditions get the action that allows to calculate the target state.
Albert Yao
commented Jul 05 '17, 11:15 p.m.
Thanks, Ralph, looking foward to your blog about "the Java provider can get called in a different way"! |
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.