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

Automate customer creation

Robert Nichols
Contributor
March 8, 2024

I'm trying to script or automate user creation. 
In PowerShell I can add customers in Jira, but the step to add them to the desk fails, or rather just doesn't work.
Using the following references 
https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/servicedesk/{serviceDeskId}/customer

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

Has anyone managed to get these to work correctly ?

2 answers

1 accepted

0 votes
Answer accepted
Anton Warkentin September 23, 2024

Hello @Robert Nichols

since you are referencing the add customer endpoint, i guess you'd like to add customers, not agents.

To add customers via REST API you actually have to perform two API calls, the first one to create the customer on the site and the second one to actually add the created customer to the service management project.

Create customer:

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

Add customer to the JSM project:

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

In case the user already exists and you need to find their id:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-user-search/#api-rest-api-3-user-search-get

I hope that helps.

Kind regards,
Anton

Robert Nichols
Contributor
September 23, 2024

Thank you, this is how I did this, calling the various Apis.
Works well and we use it frequently 

Regards 
Rob

Like Anton Warkentin likes this
Anton Warkentin September 23, 2024

Awesome!

I've also found out, that no notification are being sent, when calling those API end points, while inviting customer in the UI does trigger notifications. Could you confirm that behavior on your site?

Kind regards,
Anton

0 votes
Brian Trepto
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.
March 8, 2024

Hi @Robert Nichols

welcome to the Community!

 

I guess you're talking about JSM Customer and not Agents or licensed users.

You can create them with a Jira Automation Rule.

Suggest an answer

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

Atlassian Community Events