How do I get UID of the value from custom attribute of type contributor
I am trying to get UID of value in a custom attribute through a Java script for using in customization through Java script.
Using the link below as reference.
https://jazz.net/wiki/bin/view/Main/AttributeCustomizationExamples
Section : Get an item's UUID (users, iterations, project areas)
I am able to get the UID of contributor type using built in attribute with the following script 1.
script 1
=====================================================
dojo.provide("org.example.OwnerID");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.OwnerID", null, {
getValue: function(attributeId, workItem, configuration) {
return workItem.getValue(WorkItemAttributes.OWNER);
}
});
})();
=========================================================
Trying get the UID of custom attribute using script 2 below.
script 2
==========================================================
dojo.provide("org.example.QAVerifierID");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.QAVerifierID", null, {
getValue: function(attributeId, workItem, configuration) {
return workItem.getValue("custom.workitem.attribute.QAVerifier");
}
});
})();
===========================================================
QAVerifier is a custom attribute of type contributor.
Nothing populates with the attribute linked to this script for calculated value when I change the QAVerifier value and save it.
Any thoughts on what is wrong here ? or is there a other way to get UID ?
Using the link below as reference.
https://jazz.net/wiki/bin/view/Main/AttributeCustomizationExamples
Section : Get an item's UUID (users, iterations, project areas)
I am able to get the UID of contributor type using built in attribute with the following script 1.
script 1
=====================================================
dojo.provide("org.example.OwnerID");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.OwnerID", null, {
getValue: function(attributeId, workItem, configuration) {
return workItem.getValue(WorkItemAttributes.OWNER);
}
});
})();
=========================================================
Trying get the UID of custom attribute using script 2 below.
script 2
==========================================================
dojo.provide("org.example.QAVerifierID");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.QAVerifierID", null, {
getValue: function(attributeId, workItem, configuration) {
return workItem.getValue("custom.workitem.attribute.QAVerifier");
}
});
})();
===========================================================
QAVerifier is a custom attribute of type contributor.
Nothing populates with the attribute linked to this script for calculated value when I change the QAVerifier value and save it.
Any thoughts on what is wrong here ? or is there a other way to get UID ?
One answer
I have updated the work item you filed with my details from reproducing it. This seems to be a defect. Thanks for reporting it and your patience.
Researching this some more, this wiki article does not include Contributor on the list of types that can be safely read and returned from scripts.
Comments
Udaya Puthuraya
Jan 29 '13, 8:35 p.m.Udaya Puthuraya
Jan 29 '13, 9:34 p.m.