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

Is it possible to add a customer to an Organization via script?

amanda August 13, 2021

Hi all,

I am trying to make a script that assigns Customers to an organization upon Issue Creation with Scriptrunner.

I have used the "Add user to organization" method documented here: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-user-post

and while it works with licensed users, it turns up errors whenever I try it with a customer accountId.

{"errorMessage":"Could not find accountIds: qm%3A9c4ffcdc-c9a8-4072-a73d-f1c796ec83cd%3A86f55d53-c694-4db6-84ed-0889500b7fac","i18nErrorMessage":{"i18nKey":"sd.request.participants.validation.missing.account.ids","parameters":["qm%3A9c4ffcdc-c9a8-4072-a73d-f1c796ec83cd%3A86f55d53-c694-4db6-84ed-0889500b7fac"]}}
2021-08-13 09:18:49.728 INFO - {"errorMessage":"Could not find accountIds: qm%3A9c4ffcdc-c9a8-4072-a73d-f1c796ec83cd%3A86f55d53-c694-4db6-84ed-0889500b7fac","i18nErrorMessage":{"i18nKey":"sd.request.participants.validation.missing.account.ids","parameters":["qm%3A9c4ffcdc-c9a8-4072-a73d-f1c796ec83cd%3A86f55d53-c694-4db6-84ed-0889500b7fac"]}}


I also (without luck) tried out some suggestions found around the atlassian comunitty, such as: https://community.atlassian.com/t5/Jira-Service-Management/Organization-automation/qaq-p/225618

So I'd like to ask if there's something I have overlooked somewhere and/or if it is even possible to add Costumers to organization via script?


Any suggestions/ even a clear "not possible", is much appreciated!

Had high hopes for JSD, but without the ability to auto assign customers, it probably isn't for us.

Kind regards,

Amanda


3 answers

1 accepted

1 vote
Answer accepted
Nicola D. August 13, 2021

Of course it is possible!

here an example :

https://github.com/WuerthPhoenix/Atlassian-Extension-Scripts/blob/main/load-jsm-customer-ldap/load-jsm-customer-ldap.sh

file: load-jsm-customer-ldap (from line 116)

Cheers

 

Nicola

amanda August 16, 2021

That is very cool! Havn't tried it out, but will accept this as the answer :)

We have however decided that JSD  isn't for fit for our needs atm. But I will save this in case that changes.

Thank you so much for your help !

(This has been bugging me for weeks and eventhough we're not going to use it, this gives me peace of mind)

0 votes
David Harkins
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.
October 6, 2023

Has anyone managed this without the need for making an API call?

0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 13, 2021

Hi @amanda 

I think that you have to create your customer first (https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-customer/#api-rest-servicedeskapi-customer-post), and then to add him to an organization. Sending an API request for adding a customer to an organization, requires his/her ID. An this is created once the customer is created. 

Hope that helps :)

amanda August 16, 2021

Thanks ! :)  I tried it friday but it didn't seem to do the trick.

It gave the same error, but worked fine with a licensed user (that wasn't yet a customer).

Like Nicola D. likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events