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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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

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

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

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.
Oct 06, 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.
Aug 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 :)

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