It's all about the answers!

Ask a question

How do I get the Attribute Type using the Doors Javascript API

Andrew Lloyd (5346) | asked Jan 12 '15, 11:23 p.m.
Using the Attributes and Links example extension, I am not able to display the Artifact Type. Is there a way to get this value using the API?
I have tried using the line,


as per a similar question ( but have the same undefined error.

Furthermore, when I debug it and watch the attrs.values, the artifact type is not listed.

Accepted answer

permanent link
Peter Morgenthaler (102815) | answered Jan 13 '15, 1:11 a.m.
edited Jan 13 '15, 1:15 a.m.
Hi Andrew,

You probably have not collected the ARTIFACT_TYPE when you collect the attributes using the getAttributes call.

Change the line where you get the attributes to include the optional parameter to load the both NAME and TYPE as per below.

RM.Data.getAttributes(selected, [RM.Data.Attributes.NAME, RM.Data.Attributes.ARTIFACT_TYPE], function(result) {

Then you should be able to get the value using the attrs.values[RM.Data.Attributes.ARTIFECT_TYPE]

Hope that helps
Andrew Lloyd selected this answer as the correct answer

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.