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'); } }); }); |
One answer
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
|
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.