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

How can I get the user name of a contributor using JavaScript?

Hello,

I am trying to read the owned by attribute using the script to increase the Re Assignment counter when ever a change on the owned by )Assigned by) value is changed. But the function returns me the internal_id of the user_id in the attribute where iam capturing the owned by attribute o/p.

If i would like to convert this internal_id to a string , what is the function to be used ?

Kindly help me out to resolve this issue.

**********************************************Code  Sample*******************************
dojo.provide("com.ibm.team.workitem.hiddenassignee");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
   dojo.declare("com.ibm.team.workitem.hiddenassignee", null,  {  

   getValue: function(attributeId, workItem, configuration) {
 
        var hiddenassignee = workItem.getValue(WorkItemAttributes.OWNER);

        console.log("hiddenassignee: assignee is "+hiddenassignee);   
         return hiddenassignee ;
    }
    });
    })();





Thank You..!

Ashwath

0 votes


Accepted answer

Permanent link
Yes, for complex objects
  • getValue() returns the UUID - which could be used to set a complex item, if supported at all. 
  • getLabel() can be used to get the readable user name. Note that the user name can not be used to set anything.

Carefully read https://jazz.net/wiki/bin/view/Main/AttributeCustomization and
Lab 5
Ralph Schoon selected this answer as the correct answer

0 votes

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

Question asked: Jul 30 '15, 6:50 a.m.

Question was seen: 2,213 times

Last updated: Jan 05 '16, 4:37 a.m.

Confirmation Cancel Confirm