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

How can I Bulk Create Multiple organization records using a single REST API call

Shabana Wollin June 3, 2024

Hi

I've researched for this on the community and I've not found a way yet - how can I bulk create multiple organization records as I have over 700+ and this would be very helpful.

Currently the POST call I'm using is rest/servicedeskapi/organization with this in the Body:

{
"name": "test-0050"
},

 

and when I use

{
"name": "test-0050",

"name": "test-0051",

"name": "test-0052"
},

I get a 400 - Bad Request error.

{
"errorMessages": [
"Invalid request payload. Refer to the REST API documentation and try again."
]
}

2 answers

1 accepted

1 vote
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 3, 2024

Hi @Shabana Wollin,

Welcome to Atlassian Community!

The endpoint only except a single organization as the payload, so the error you get is expected. What you can do is use something like Postman which allows you to run a collection with imported data.

Shabana Wollin June 3, 2024

I've not explored that - thank you. Can you let me know if this available only in Postman or would Talend API app also have a similar feature for running collections ?

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 3, 2024

I have never used Talend so cannot say if it has a feature that would allow you to run collections. But if it has a loop feature then you should be able to do it.

Shabana Wollin June 3, 2024

Can someone let me know what the POST call should look like. 

rest/servicedeskapi/organization (or)

rest/servicedeskapi/organization/name:{Organization Name}

I was able to use Postman and setup the collection to loop through the CSV file. However now I'm faced with a new issue - where it is not actually creating the organization from the CSV file.

I'm getting a 404 Not Found Error.

Upon reviewing the Request Response I see that it is formed correctly

{

"name": "test-1234"

}

thanks

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 3, 2024

Your post call should go to rest/servicedeskapi/organization and then in your body you will add the data. Something like this in Postman:

Screenshot 2024-06-03 at 4.23.14 PM.png

Shabana Wollin June 4, 2024

@Mikael Sandberg I was able to fix the error I was getting - It was expecting for me to pass the Authorization token where I had it set to "Inherit from Parent" after I was doing a Get Organizations. After I changed the order of execution and added back the Authorization Token - I was able to get the Organization records created successfully - Thank you

Now, I am looking to Add The newly created Organization into my Service Project and I'm stuck at how to parse the POST URL successfully right after the create - do you have any suggestions or would I open a new thread for the question ? thanks.

0 votes
Prince Nyeche
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.
June 3, 2024

I believe you've figured out a way to do this in a loop. If you're not scripting a solution, the API call might not be as intuitive as required. However, why struggle with API when there are free apps that perform bulk creation of organization available on the Atlassian Marketplace?

Shabana Wollin June 3, 2024

Unfortunately we have a long process for getting Marketplace Apps approval and as I can manage how to script already - it gives me the ability to customize our requirements easily without having to rely on Apps.

I was also not aware of what Free Apps currently create organizations in bulk - I could check them out ? thanks 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events