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

Using script-based calculated values to set multivalue attributes

I wonder whether it is possible to use calculated values to set the content(s) of a multivalue attribute.
This is my case: I want that, according to the "Filed Against" attribute (i.e. according to the Team Area), the
"Subscribed By" attribute is filled with a different list of users.
So, is it possible to have the .js script return an array (collection, list, ...) of values (instead of a string)?
My RTC version is 4.0.6

0 votes


Accepted answer

Permanent link
Subscribers is actually a link and not an attribute, so cannot be set this way. The API for the scripts is here, including the valid return types.
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript

There are more options if you want to do something complex like invoke a REST service or implement a Java Customization. ref: https://jazz.net/forum/questions/19148/add-subscriber-in-work-item-by-programming?redirect=%2Fforum%2Fquestions%2F19148%2Fadd-subscriber-in-work-item-by-programming

Lawrence Smith [IBM]
Luca Martinucci selected this answer as the correct answer

1 vote


One other answer

Permanent link
You can look at the many discussions around this and look if someone found a solution here:
https://www.google.com/search?q=subscriber+javaScript+site:jazz.net

From my perspective it will not work especially not for the subscribers, which is not a real attribute either, but a collection.
You can also not just set a value with JavaScript - you can't even access the subscribers there see https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of - you can only return a value in a calculated value. It would ALWAYS return the value if the dependent attribute changes and it would not add, it would set the attribute value. There goes your subscribers that subscribed themselves.

Anyway, I tried and I couldn't.

1 vote

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

Question asked: Apr 10 '15, 8:42 a.m.

Question was seen: 3,651 times

Last updated: Apr 10 '15, 10:47 a.m.

Confirmation Cancel Confirm