Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

IBM RTC CCM: java scripting, how to have identify diference between creation of WI vs. Modify

 HI, 

I'm using javascript to gather field values and sending them to a external web service, but I need to know when is a new work item just recently created or an existing one that was modified, is there any attribute like state or something that can help me to identify when is a new WI or not? so far I can see the same values because when a new WI is created the ID is genered before the user populate, the state can be the same, so I'm not sure how can I make that difference of actions. 
Thank you. 

0 votes


Accepted answer

Permanent link

 As far as I am aware it is very hard, up to impossible, to detect a state change in the JavaScript API. See https://rsjazz.wordpress.com/2016/07/15/rtc-process-customization-what-you-can-and-cannot-do/ . It might be possible to work around that by storing some data in a hidden attribute, but I would discourage to do that.


The JavaScript attribute customization is, for all I can tell not designed to drive such integrations and it should not be used for that. It can be called many times during working on a work item and it is not fit for the purpose.

If you want to write this kind of integrations, use the follow up action extension point in the RTC server API and write a participant. The participant can detect a state change, it can access all work item data and it is better performance wise.

Another option could be an asynchronous task, not sure about that. 

Rafael Rodriguez Montes selected this answer as the correct answer

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936

Question asked: Jul 03 '19, 4:40 p.m.

Question was seen: 1,315 times

Last updated: Jul 04 '19, 1:38 a.m.

Confirmation Cancel Confirm