Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I cannot recover the subcategories of the assets

Sergio Sotillo Rábano
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 30, 2024
Hello everyone,

First of all, thank you for your time.

As you can see in the JIRA image in my schema tree, there are several categories of products (speakers, headphones, printers...).

From my java client using Unirest.get(url) I have no problems retrieving the schema categories using the following call https://api.atlassian.com/jsm/assets/workspace/ID-WORKSPACE/v1/objectschema/2 or If I want to recover a specific object I can use
https://api.atlassian.com/jsm/assets/workspace/ID-WORKSPACE/v1/object/ID-NUMBER

Viewing the image How can I retrieve the JSON list of all the objects in a category from Java? For example, how can I recover the JSON of the 290 Laser printers?

I have looked at the following documentation
https://developer.atlassian.com/cloud/assets/rest/ but I don't get what I want

thank you

ComunidadJira.png

 

1 answer

0 votes
Kai Becker
Community Champion
January 30, 2024

Hi @Sergio Sotillo Rábano 

welcome to the community and thanks for your question.
Your on the right track but I would recommend to use an aql search for getting the relevant objects.

Documentation can be found here: https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-aql-post

In the example code you will need to modify the payload in line 5 to

payload.put("qlQuery", "objectType = Laser"); }
Sergio Sotillo Rábano
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2024

Thanks for your answer. @Kai Becker 

I tried to do what you told me but it gives me an error and I don't understand why since I am using the same code that comes in the api
https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-aql-post

I am attaching screenshots of the code and console output.

console.pngcodigo.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events