Widget implementation in Jazz DNG
I want to implement a widget, that can change the Artifact type of an selected artifact. I thought, that i can do with the setAttribute method. But unfortunately the changes will not be made but also no error will be reported.
RM.Data.getAttributes(row.ref, [ RM.Data.Attributes.IDENTIFIER, ], function(opResult) { if(opResult.code == RM.OperationResult.OPERATION_OK) { var rowToChange = opResult.data[0]; RM.Client.setSelection(rowToChange.ref); var artType = new RM.ArtifactType(attrType); rowToChange.values[RM.Data.Attributes.ARTIFACT_TYPE] = artType; // save change in the row RM.Data.setAttributes(rowToChange, function(result){ if(result.code !== RM.OperationResult.OPERATION_OK) { // error handling code here console.log(result); $("#errorlist").append("<div class=\"error-entry\">Save was not successful.(ID: " + row.values[RM.Data.Attributes.IDENTIFIER] + ")</div>"); } }); } else { $("#errorlist").append("<div class=\"error-entry\">Load artifact attributes for save was not successful.(ID: " + row.values[RM.Data.Attributes.IDENTIFIER] + ")</div>"); } }); |
Be the first one to answer this question!
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.