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

How to update attribute value based on workflow action

Hello,

I am looking to update an attribute value of a work item on a save action, depending upon the action that the user selected when hitting save. For example, our defect work item has Retest and Reopen states/transitions, and we have date fields for both to indicate the day it was set to retest or reopened. We set them manually now, but I would like those to be read only attributes that are populated automatically on save based on the transition.

Our server admin doesn't allow Java extenstions, so I have been looking a bit at the JavaScript API for attribute customization. However, I am unable to find any way with the options given to accomplish what I'm looking for. Using a Calculated value would make the most sense, but as far as I can tell you have no knowledge of the action that was fired, only the current state. I see a getWorkflowAction() in the API but that's only accessible on Conditions, which don't look like they're really used to set attribute values.

Any advice on the best way to accomplish this?

Ryan

1

0 votes


Accepted answer

Permanent link
There are several approaches I have seen. My preferred approach would be a participant. See the following posts with examples: https://rsjazz.wordpress.com/?s=participant. The paticipant can easily detect the state change and then modify the value as needed. It has all API available you could ask for and it is a proven solution.

I have seen people trying this with JavaScript - a calculated value that passes the current value and only changes it in case of a state change. The trouble is, that there is no reliable way to detect the state change. I think you can access the action selected, but that is about it.

Ryan Koppelman selected this answer as the correct answer

0 votes

Comments

Thanks, it sounds like this probably is the best approach. I will see if I can work with my server admin to get an exception in deploying this customization. 

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: Apr 15 '14, 12:35 p.m.

Question was seen: 4,188 times

Last updated: Apr 16 '14, 8:14 p.m.

Confirmation Cancel Confirm