It's all about the answers!

Ask a question

I can not get the values of Artifact attributes


karim taoudi (113) | asked Mar 16 '17, 1:17 p.m.
edited Mar 16 '17, 1:25 p.m.

 Hello , 


I'm working on a basic script that displays the Name and the type of the selected artifact ;
but I did not get any displayed value.
I tried to customize it and what i get as the return value is "undefined" 

here is my code : 

function onselection(selected)
{
if(selected.length == 1)
{
prompt("entred","1");
RM.Data.getAttributes(selected,RM.Data.Attributes.Name, function(result) 
{
document.getElementById("attributes").innerHTML="Artifact Name : " + result[RM.Data.Attributes.NAME];
});
}else document.getElementById("attributes").innerHTML="failed";

}

RM.Event.subscribe(RM.Event.ARTIFACT_SELECTED, onselection); 



Comments
karim taoudi commented Mar 17 '17, 5:05 a.m. | edited Mar 27 '17, 7:20 p.m.

Here are more details about what I am trying to do :


After I selecte an Artifact inside or outside a Module, I want to display the Type of this Artifact and Its name.

One answer



permanent link
Donald Nong (14.5k614) | answered Mar 16 '17, 10:40 p.m.

What are you trying to do? Your code makes no sense to me.

I suggest you take a good read of the official documentation and samples.
https://jazz.net/wiki/bin/view/Main/RMExtensionsMain

Once you're comfortable with those samples, you can then start writing your own codes.

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.