Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Attribute Customizations - Calculated Value - How do I extract a name from the UUID for Creator

I want to assign the name of the work item's creator to a custom field.  I can figure out how to extract the UUID for the Creator field, but don't know how to fetch the name in the form of a string for my calculated value script from the UUID.

0 votes



2 answers

Permanent link
currently there is no mechanism to get from UUID to contributor name in Javascript

see https://jazz.net/forum/questions/80964/how-to-get-contributor-name-by-javascript
you would have to write a java participant server plugin

0 votes


Permanent link
 Try workItem.getLabel().

0 votes

Comments

getlabel() on what? the UUID or the contributor entry?

instead of

var uuid= workItem.getValue( WorkItemAttributes.OWNER );

try using

var name_or_id = workItem.getLabel( WorkItemAttributes.OWNER );

I am not sure if it returns the readable user ID or the user name though.

Cannot find function getLabel in object [object com.ibm.team.workitem.shared.common.internal.scripting.facades.WorkItemAPIType].

my js statement:  workItem.getLabel(WorkItemAttributes.CREATOR)

I used it in https://jazz.net/library/article/1093 Lab 5 and it works for me. It might have been introduced in 4.0.

I am using your js and I am erroring out on this statement,

                out+="Creator Name: " + workItem.getLabel(WorkItemAttributes.CREATOR)+"\n";

Tried this with RTC 4.0.1

I am using my lab 5 solution files from https://jazz.net/library/article/1093 (calculated against the description) and it works for me in 4.0.1. It actually provides the name and not the ID.



works fine when you use the right client, duh, thanks

showing 5 of 7 show 2 more comments

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,159

Question asked: Apr 10 '13, 5:33 p.m.

Question was seen: 7,266 times

Last updated: Apr 13 '13, 8:38 a.m.

Confirmation Cancel Confirm