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

Unable to set attributes via RM API

I am trying to set attributes for a selected artifact. I am able to change the attributes without errors if the artifact is a Requirement. We have different artifact types and I cannot update their values via my script.

Here is what I am doing. This works when the selected artifact is a 'Requirement' I want to use this with a different artifact type.

M.Data.getAttributes(ref, [RM.Data.Attributes.ARTIFACT_TYPE], function(result) {
     
      // Store any required attribute changes here
      var toSave = [];
     
      var artType = new RM.ArtifactType('TRT Requirment');
      // Go through artifact data examining priority values
      result.data.forEach(function(aa){
      
         var raised = 34;
        // Reuse the existing RM.ArtifactAttributes
       aa.values['VerifiedCount'] = raised.toString();
       toSave.push(aa);
     }
      });
     
          // Perform a bulk save for all changed attributes
      RM.Data.setAttributes(toSave, function(result){
              if(result.code !== RM.OperationResult.OPERATION_OK)
              {
              console.log('error');
        }
          });
   });   

0 votes



One answer

Permanent link
 Hi Pooja,
on the artifact you are trying to modify, does the artifact type include the VerifiedCount attribute?
You don't describe the manner in which this script fails.  Does the setAttributes call return success or failure and, if it's a failure, what is the message?
thanks,
-Dominic

0 votes

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
× 10,943
× 7,501

Question asked: Mar 12 '15, 2:53 p.m.

Question was seen: 4,065 times

Last updated: Mar 30 '15, 5:05 a.m.

Confirmation Cancel Confirm