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

How to copy owned by to another custom attribute

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");
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);
        }

    }

    });
})();


This is the error that I'm receiving:

There was an error on this page.

Error description: workItem.getValue(...) is null

Click OK to continue.

Can anybody help me with this error?

0 votes



One answer

Permanent link

"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.

0 votes

Comments

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?


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.

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
× 12,033

Question asked: Aug 16 '18, 9:47 a.m.

Question was seen: 1,788 times

Last updated: Aug 16 '18, 4:05 p.m.

Confirmation Cancel Confirm