Forums

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

JSD Cloud API

Romer Ventura
Contributor
November 14, 2018

Hello,

A few months back, i was able to add multiple organizations via the API in one call, i would simple set the data to:

{
"name": "COMPANY A",
"name": "COMPANY B",
"name": "CCOMPANY C"
}

And all my Organizations would be created, now, the API throws an error about not recognizing "name" when more than 1 organization is passed... I guess this was changed?

Also, I need to add about 1000 customers (internal customers). looks like i will have to do a call for each user, correct?

Will i need to add any delays in between calls?

Thanks

1 answer

0 votes
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 16, 2018

Hi Romer,

Are you using the API provided on our documentation?

Create organization

Create customer

As per I could check, there is no restriction to add more than one customer.
Can you please send us the errors that you are receiving?

Regards,
Angélica

Romer Ventura
Contributor
November 16, 2018

Yeah, that's what i am using and saying, before i could pass multiple organizations in 1 call, now i cant:

I am passing as data:

/rest/servicedeskapi/organization

{
"name": "COMP-1",
"name": "COMP-2",
"name": "COMP-3",
"name": "COMP-4"
}

Response:

{
"errorMessage": "Unrecognized field \"name\" (Class com.atlassian.servicedesk.api.rest.dto.domain.organization.OrganizationCreateDTO), not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@774cca17; line: 3, column: 12] (through reference chain: com.atlassian.servicedesk.api.rest.dto.domain.organization.OrganizationCreateDTO[\"name\"])"
}

 This no longer works. According to Postman, last time i used the above and that it worked was in April, i used it to create multiple orgs at once.

And for creating customers, if i send:

/rest/servicedeskapi/customer

 {
"email": "user1@company.com",
"displayName": "User 1"
},
{
"email": "user2@company.com",
"displayName": "User 2"
},
{
"email": "user3@company.com",
"displayName": "User 3"
}

Then, only the first user is created. The rest are ignored. TO be fair, i never tried to add more than 1 customer in the past so i cant tell if it worked or not before.

Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 29, 2018

Hi Romer,

I've tested here and it indeed does not work, only works if I create one organization. I've tried to provide an array of strings, but I received a 500 error saying that Jira was not able to deserialize the instance.
I've checked here with the team responsible for API and they said that it never worked.
What might have worked is the first org got created, by accident, and the JSON parser is now stricter.
About customer creation, I tested here too and it creates only the first one.

Regards,
Angélica

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events