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
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
Accepted answer
Yes, for complex objects
Carefully read https://jazz.net/wiki/bin/view/Main/AttributeCustomization and
Lab 5
- 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