How to calculate 'Owned By' attribute value based on another attribute value?
Hi
I would like to calculate the 'Owned By' attribute value based on another attribute's value on the same workitem. I tried by adding a dojo script to the 'Calculated Values', but I am not sure how to return a user (contributor) from the dojo code. Is it possible to return a contributor from the script? If yes, then how to do so?
Can anyone help plz, Thanks in advance.
Regards,
Vijay
One answer
it is possible to return a contributor from the script, you need to return the specific id associated with the contributor.
below is a sample on setting the contributor to unassigned, which might give you an idea on how to go about it:
how-to-set-contributor-type-field-to-unassigned-in-attribute-customization-script
if the attribute whose value needs to be used for Owned By is of the Contributor type, your task is simplified. you just need to do a getValue on the source attribute and use it to be returned from your script.
below is a sample on setting the contributor to unassigned, which might give you an idea on how to go about it:
how-to-set-contributor-type-field-to-unassigned-in-attribute-customization-script
if the attribute whose value needs to be used for Owned By is of the Contributor type, your task is simplified. you just need to do a getValue on the source attribute and use it to be returned from your script.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jan 10 '13, 7:37 a.m.In addition to Dinesh's answer, please be aware that there is no way to search for contributors in the script. You can not access team areas or project areas, nor roles of the users. Others have stored the UUID's of users in the script configuration.
There might be a way to useĀ a HTTP based Value Provider from within the script, like described in this post: http://jorgediazblog.wordpress.com/2012/06/27/work-item-customization-httpconector-and-oauth-in-rtc-4-0-for-oslc/ but I haven't tried it.
This is one of the cases, where you might want to think about another solution, such as a Java extension. Some possible scenarios are described in rsjazz.wordpress.com.
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jan 10 '13, 7:39 a.m.And you might want to look at https://jazz.net/library/article/1093 the next Lab (5) about Java Script is in the queue to be published soon.