It's all about the answers!

Ask a question

Using script-based calculated values to set multivalue attributes


Luca Martinucci (1.0k294112) | asked Apr 10 '15, 8:42 a.m.
edited Apr 10 '15, 8:47 a.m. by Ralph Schoon (63.1k33646)
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

Accepted answer


permanent link
Lawrence Smith (3764) | answered Apr 10 '15, 10:47 a.m.
JAZZ DEVELOPER
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

One other answer



permanent link
Ralph Schoon (63.1k33646) | answered Apr 10 '15, 9:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

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.