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

How to set artifact values using RM.Data.setAttributes

Hello,

I wright the below script and trying to set the artifact values for the attribute Priority. Below I am trying to assign '7' to Priority. It is not working. 

RM.Event.subscribe(RM.Event.ARTIFACT_SELECTED, function(artifacts) {
RM.Data.getAttributes(artifacts, [RM.Data.Attributes.First,"Priority"], function(opResult) {
var attrs = opResult.data[0];
alert("Priority attribute is :" +attrs.values["Priority"]);
var priority = 7;
alert("Priority "+priority);
attrs.values["Priority"] = priority;
toSave.push(attrs);
});
RM.Data.setAttributes(toSave, function(result){
         if(result.code !== RM.OperationResult.OPERATION_OK)
         {
            alert("in IF Loop");
         }
else
 {
alert("in Else Loop");
 }
});

Please tell me the what is the issue and how to set the value in artifact?

0 votes


Be the first one to answer this question!

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
× 10,938

Question asked: Apr 22 '15, 6:25 a.m.

Question was seen: 2,386 times

Last updated: Apr 22 '15, 6:25 a.m.

Related questions
Confirmation Cancel Confirm