How to copy owned by to another custom attribute
![](http://jazz.net/_images/myphoto/7c2ee1243bda856ed582ce0015b920ec.jpg)
Hi!
I'm writing a script part by part to copy who's the owned by to another custom attribute. The goal is to show who was the first owner of the workitem.
So, I'm writing the script my issue is that I'm receiving a error message saying that my var is null and I don't understand why.
dojo.provide("com.example.1stOwned");This is the error that I'm receiving:
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
dojo.declare("com.example.1stOwned", null, {
getValue: function(attribute, workItem, configuration) {
try {
var hold = workItem.getValue("com.ibm.team.workitem.attribute.owner");
return hold.toString();
}
catch(err) {
var txt;
txt="There was an error on this page.\n\n";
txt+="Error description: " + err.message + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
}
}
});
})();
There was an error on this page.
Error description: workItem.getValue(...) is null
Click OK to continue.
Can anybody help me with this error?
One answer
![](http://jazz.net/_images/myphoto/7c2ee1243bda856ed582ce0015b920ec.jpg)
"com.ibm.team.workitem.attribute.owner" is an incorrect ID. The Eclipse client shows a wrong external ID that JavaScript does not use.
See the definitions in https://jazz.net/wiki/bin/view/Main/AttributeCustomization or look up the ID string in the Web Admin UI.
Comments
![](http://jazz.net/_images/myphoto/7c2ee1243bda856ed582ce0015b920ec.jpg)
Now, I'm receiving this error message:
There was an error on this page.
Error description: WorkItemAttributes is not defined
Click OK to continue.
Where do i get to Web Admin UI?
![](http://jazz.net/_images/myphoto/e5e63d5878217b64611c1df9401b7cd3.jpg)
See the second script in https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Script_based_calculated_values and where
com.ibm.team.workitem.api.common.WorkItemAttributes;
shows up and how.
Where do i get to Web Admin UI?
If you don't know that, you should probably not do this.Talk to one of your process admins. Or open it using the Open Web UI on the project area in the Eclipse client on the project.
See https://jazz.net/library/article/1093 the RTC version lab 5 for more information about JavaScript Attribute customization.