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

Unable to copy RTC workitem description using javascript

Hi, 

 

I am trying to copy the RTC WI description value to a medium string / Html box using the script attached and it is not working.

 

dojo.provide("com.example.common.MyClass");

dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

 

(function() {

dojo.declare("com.example.common.MyClass", null, {

 

    getDefaultValue: function(attributeId, workItem, configuration) {

     

        var value =  workItem.getValue(workItemAttributes.DESCRIPTION);

        return value;

   

    }

  

});

})();

       

The Same script is working between two custom attributes.

       

I tried replacing the description attribute id as wee, no luck !

       

Any help on this is much appreciated.

0 votes


Accepted answer

Permanent link

I created a calculated Value with the below script based on yours and set  it to a custom attribute: medium string or HTML and this works for me:

dojo.provide("com.example.common.MyClass");

dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.example.common.MyClass", null, {

    getValue: function(attributeId, workItem, configuration) {

        var value =  workItem.getValue(WorkItemAttributes.DESCRIPTION); 
   
         return value;

    }
});

})();

Hareesh Jairaj selected this answer as the correct answer

0 votes

Comments

 Hi Don Yang,


Thank you, This code is working fine.

When compared, I found the below line is the only difference from my script.
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

Can you please explain how this line makes the difference.

Thanks in advance
Hareesh.

Hareesh,

Glad to know it works for you.
In your codes, you use var value =  workItem.getValue(WorkItemAttributes.DESCRIPTION);  in which WorkItemAttributes is used but it is not defined.
Thanks

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,030
× 42

Question asked: Jun 04 '15, 11:57 a.m.

Question was seen: 2,607 times

Last updated: Jun 05 '15, 6:12 p.m.

Confirmation Cancel Confirm