Forums

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

How can I lookup a customer accountId to automatically add them to my Jira Service Desk organization

Nathan Given
Contributor
April 22, 2019

I'm creating a sync between Jira Service Desk and another system that has customer email addresses and I want to bulk add customers to organizations within Jira Service Desk.

With the upcoming changes in the Rest API, I can't figure out how to convert my list of customer email addresses into an accountId .

I need the accountId in order to add customers to organizations, so it seems until I can successfully lookup the accountId I'm stuck.

Thank you~!

2 answers

2 accepted

2 votes
Answer accepted
Jakub Sławiński
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.
April 23, 2019

Hi @Nathan Given ,

 

you should get the accountId as a response when creating the customer. Please take a look at the REST API documentation:

https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-customer-post

0 votes
Answer accepted
Nathan Given
Contributor
April 23, 2019

Here's another way if the customer already exists:

https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-servicedesk-serviceDeskId-customer-get

(it turns out I needed @Jakub Sławiński suggestion with this one.)

David Orazine April 14, 2020

Nathan,

Is there away to do a search on that call? It just returns all users for me.

David

Nathan Given
Contributor
April 15, 2020

@David Orazine 

 

I couldn't figure out a search... so I just got back all users, stored them in-memory, and had my bulk load only run once a day so as to not slow down any realtime or transactional requests.

Like David Orazine likes this
a.pantechovskis
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 27, 2021

It has query parameter.

The returned list of customers can be filtered using the query parameter. The parameter is matched against customers' displayName, name, or email. For example, searching for "John", "Jo", "Smi", or "Smith" will match a user with display name "John Smith".

Martin Stengård
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 10, 2022 edited

/rest/servicedeskapi/servicedesk/<id>/customer?query=<email>

together with post if no matches were found worked for me. Make sure to add the header below when using the customer api.

'X-ExperimentalApi' = 'opt-in'

Like Nathan Given likes this

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira service management, devops, ship quality code, atlassian webinar, continuous delivery, integrated workflows, change management, developer productivity, agile teams, atlassian community events, ace, atlassian learning

Ship quality code faster with Jira Service Management ✨

In the wake of growing customer expectations, development teams are facing more pressure to deliver innovations faster. Register for this 45-minute webinar to learn how devs can accelerate software delivery and time-to-market with Jira Service Management.

Register now 🚀
AUG Leaders

Atlassian Community Events