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

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

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,

attrs.values[RM.Data.Attributes.ARTIFACT_TYPE];

as per a similar question (https://jazz.net/forum/questions/169582/how-can-we-use-rdng-extensions-api-to-detemine-the-artifact-type-of-the-currently-selected-artifact) but have the same undefined error.

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

1

0 votes


Accepted answer

Permanent link
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

1 vote

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
× 10,938

Question asked: Jan 12 '15, 11:23 p.m.

Question was seen: 4,403 times

Last updated: Jan 13 '15, 1:15 a.m.

Confirmation Cancel Confirm