It's all about the answers!

Ask a question

How to calculate 'Owned By' attribute value based on another attribute value?


Vijayakumar Balasubramaniyan (2845) | asked Jan 10 '13, 7:05 a.m.

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


Comments
Ralph Schoon commented Jan 10 '13, 7:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 commented Jan 10 '13, 7:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.

One answer



permanent link
Dinesh Kumar B (4.1k413) | answered Jan 10 '13, 7:19 a.m.
JAZZ DEVELOPER
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


Register or to post your answer.