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. |
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.
Comments
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.
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.