Forums

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

Create customer in a specific service desk project

Sami Perrin
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!
March 13, 2019

When using the route POST /rest/servicedesk/user as documented here, it seems to create a user and it's not possible to assign a specific project.

By looking the way the Atlassian front end does it, it seems to POST on /rest/servicedesk/1/pages/people/customers/pagination/<project>/invite with

{"emails":["<customer email>"]}

This second method does precisely what we want as it can be called with API token, creates a user with the right permissions and returns success even if the customer already exists or is a Jira user.

Thus, is it safe to use the second method as it is not documented in the rest API's. And if not what is the proper way to do this?

 

1 answer

1 accepted

0 votes
Answer accepted
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 14, 2019

Hi Sami and welcome to Atlassian Community!

We do not suggest using an API that is not documented, in this case, the best solution is to use two APIs, the one that you mentioned to create the customer and then run the API to add the customer to the project.
You can find the details of this API here.

If you have any other question, please let us know!

Regards,
Angélica

Sami Perrin
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!
March 19, 2019

Hi Angelica and thank you for your answer,

 

Alright, so we managed to switch to the official method and now the code works.

 

As a suggestion, providing a helper route like the one you use internally could be useful as to remedy the situation the code became more complex. In effect, now we first try to create the customer, and if it fails we search for the user and then add it to the correct service desk. So 3 API calls instead of one.

 

Thank you for your help,

 

Sami

Like Angélica Luz likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events