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
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
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]
One other answer
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.
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.