Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Another Assets Question - creating multiple objects via the API in one objecttype

Ste404
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 18, 2024

I was looking at this page

https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-create-post

and having a working powershell script that populates on object in an objecttype with the relevant details, works great.

What if I have 30 objects I want to create, I am not sure on that page how you would achieve that, I doubled up on the attributes but it just made an object of the last lines in the script.

Has anyone created many objects in an objecttype with rest before and could offer up some guidance.

 

ta

 

1 answer

0 votes
Hakan Bahadir _Pio_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 18, 2024

Hello,

You need to call the api for every object one by one. In summary, for 30 new objects you need to send http post 30 times.

 

Alternatively, you can use the Import API.

https://developer.atlassian.com/cloud/assets/imports-rest-api-guide/schema-and-mapping/

 

My humble opinion:

- If you will create objects continuously and in large amounts (i.e. thousands), then Import API is better.

- On the other hand, if you will create less than 100 objects time to time, then normal API would be sufficient.

 

Cheers.

Hakan Bahadir

Pio

 

Ste404
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2024

Well that is annoying, I was hoping you could loop through a script.  I have it pushing the one in Powershell, but was hoping to be able to stack them a number of objects.

 

thanks for the reply.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events