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

In an RM extension, is it possible to change the content (not attributes) of an artifact?

I would like to change the content (not attributes) of an artifact directly in an RM (DNG) extension. Is this possible?

0 votes



One answer

Permanent link

Yes.  The Client API allows you to do this.  To set the "Content," use Primary Text, which will is referenced as RM.Data.Attributes.PRIMARY_TEXT in your code.  So if item is of type RM.ArtifactAttributes for your artifact, something like this will set the content.  

var toSave = [];
item.values[RM.Data.Attributes.PRIMARY_TEXT] = "New Value of Content Here";
toSave.push(item);
RM.Data.setAttributes(toSave, function(result){
    if(result.code !== RM.OperationResult.OPERATION_OK)
    {
        // error handling code here
    }
});
This is only a slightly edited version of the sample code for setAttributes in the Client Extension API here (https://jazz.net/wiki/bin/view/Main/RMExtensionsAPI605#SetAttributes).  To get the RM.ArtifactAttributes data type(item above), as easy way to start is using RM.Client.showArtifactPicker to get the RM.ArtifactRef, and then give the result of this to RM.Data.getAttributes to get the RM.ArtifactAttributes.

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
× 12,019

Question asked: Mar 01 '19, 11:22 a.m.

Question was seen: 2,121 times

Last updated: Mar 04 '19, 4:08 p.m.

Confirmation Cancel Confirm