It's all about the answers!

Ask a question

Read the primary text of an artifact, RM.Data.getAttributes


Anas Musharraf (112) | asked Jun 05 '18, 12:54 p.m.

I have been struggling to use RM.Data.getAttributes, i dont understand the documentation. I am trying to create a widget which i activate when in a module and in my console  i want to see the primary text.

One answer



permanent link
Rosa Naranjo (2.9k11723) | answered Jun 05 '18, 4:57 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hello
Have you tried looking at the sample, ModuleExplorer?
It might display primary text, I am not sure.

Comments
Anas Musharraf commented Jun 06 '18, 11:13 a.m.
Im trying to use a widget to get this can you help me with the following:
RM.Event.subscribe(RM.Event.ARTIFACT_SELECTED, function(module) {
    console.log("--- Test for RM.Data.getContentsStructure ---");
    RM.Data.getContentsAttributes(module[0], [RM.Data.Attributes.PRIMARY_TEXT], function(result){
        if(result.code == RM.OperationResult.OPERATION_OK) {
            result.data.forEach(function(item){
                console.log(item.values[RM.Data.Attributes.NAME]);
            });
        }
        else {
            console.log("RM.OperationResult.OPERATION_KO");
            return;
        }
    });
});


Anas Musharraf commented Jun 06 '18, 11:13 a.m.

error is:
item.values is undefined


Rosa Naranjo commented Jun 06 '18, 11:53 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Sorry, I can't help with that part. Someone from development would have to comment.  You could get IBM Services to help with this but that would be at a cost.

Your answer


Register or 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.