It's all about the answers!

Ask a question

Using Work Items attribute customization( java script ) can we set subscribers based on a Status?


Aparna Sukumaran (333760) | asked Dec 08 '14, 8:25 p.m.
I have script which I use for assigning Owner WorkItemAttributes.OWNER

for Subscriber I don't see any
  built-in attributes of the work item.

Any suggestions on assigning subscribers for workitem?

One answer



permanent link
Susan Hanson (1.6k2201194) | answered Dec 08 '14, 9:56 p.m.
I dont' believe SUBSCRIBERS attribute is supported via JavaScript (https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript) .. We set subscribers on creation of certain work items but we do it via Java-based participants.

Comments
Ralph Schoon commented Dec 09 '14, 5:31 a.m. | edited Dec 09 '14, 5:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I want to support Susan's statement.

You can, as far as I am aware, not access the subscribers. They are not an attribute but a collection. There is no attribute defined either. See: https://jazz.net/forum/questions/108554/calculated-value-script-to-read-work-item-subscribers-rational-team-concert


Aparna Sukumaran commented Dec 09 '14, 12:54 p.m.

Is there any other way to set subscriber based on few other attributes? eg- want to subscribe to a user if the status is Submitted and a component is X?


Susan Hanson commented Dec 09 '14, 2:50 p.m.

Yes, within a java-based participant. Within the participant, you have normal java logic based on the values present in the work item after the save.  You can get the status and the component (whatever attribute that is, the built-in Category or a custom attribute) and then based on if-then-else logic, subscribe who you want.


Ralph Schoon commented Dec 10 '14, 2:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

See https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/ for a participant and https://rsjazz.wordpress.com/2012/08/02/subscribing-to-a-work-item-using-the-java-api/ for the API. It is client API, but the common API on the server would allow this in the same way.

Your answer


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