Fetching custom attributes for multiple items at the same time REST API
I'm using REST API to fetch my data from NDG. I want to fetch the customAttribute attribute from the item so im using this url to reach the item I want to fetch: https://<localhost>/rm/publish/resources?resourceURI=_vu0WQVrkEeagjv4ysZcIGA
Then i'm using a Xpath expression to fetch the correct attributes, in this case:
"//attribute:customAttribute[@attribute:name='Valid for Radio']/@attribute:literalName
Right now im looping through all the artifacts and that causes about 80 calls to the server. Which takes a very long time, is there a better way to fetch the custom attributes from multiple items?
|
One answer
Regardless custom attributes or built-in ones, if you want to retrieve them from multiple items, simply add the UUID after "resourceURI=", separated by commas. So your request URL will look like
Comments
Staffan Solin
commented May 18 '17, 7:28 a.m.
Thanks for you answer Donald,
Eventhough im using the method you mentioned with combining all the items to one long string and doing calls it doesnt seem to work any faster. It is less calls to the database but when im doing my Xpath expression it takes a very long time.
Might the loadtime be so long becuase my xpath expression is to complex?
Here is my xpath expression: "//attribute:customAttribute[@attribute:name='Green']/@attribute:literalName | //attribute:customAttribute[@attribute:name='Identifier']/@attribute:name"
Is there any way to make it shorter if that is the reason for the long loadtime?
|
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.