JSD Customer/Organization API multi record creation


#1

Hello,

I am trying to create multiple customers at once using the API, and only the first record is being created:

POST /rest/servicedeskapi/customer

 {
   "email": "user1@domain.com",
   "displayName": "user1"
 }, {
   "email": "user2@domain.com",
   "displayName": "user2"
 }, {
   "email": "user2@domain.com",
   "displayName": "user2"
 }

Also, back in April/May i was able to use the API to create multiple organizations at once, now it is no longer possible:

POST: /rest/servicedeskapi/organization

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

The above returns:

"message": "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@74cfe6aa; line: 3, column: 12] (through reference chain: com.atlassian.servicedesk.api.rest.dto.domain.organization.OrganizationCreateDTO[\"name\"])",
    "status-code": 500,

I could wrap all both into a loop, but i feel that if i have if i create 1000+ internal customers i m gonna be making that many API calls…

Any ideas?
Thanks


#2

Hi @r.ventura,

Based on the REST API docs for Create customer and Create organization, it seems there’s no provision for bulk creation, hence, the results you’re facing. If your use case requires you to create bulk customers and organizations often, looping through n customers/organizations sounds like a lot of calls. If this is blocking your development, feel free to raise it in Developer Service Desk and we’ll work with you from there.

Cheers,
Ian