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. |
Accepted answer
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
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.