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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Setting the Reporter for the ServiceDesk via the API

Hello,

We have custom forms built in our applications which we link to JIRA ServiceDesks issues via the API.

I have 2 questions relating to this:

1. The user is logged into the app so we know their FirstName,LastName and email address. Is there a way that, if we match their email within JIRA then we set the reporter to that user within the issue?

2. If the user is not matched via email address, is there a way to create a customer account within JIRA via the API which will then set the reporter to the user logging an issue via the application form?

1 answer

1 accepted

1 vote
Answer accepted
Keri Atlassian Team Oct 25, 2018

Hey Dan,

 

Thanks for reaching out to the Atlassian Community!

 

You can call the CreateCustomer REST API end point with the customers email address. If this returns back 400 then the customer already exists, or there is a problem with the email address.  If it doesn’t exist it will create a new customer:

https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/customer-createCustomer

 

You’ll want to make sure that you do some email validation before calling this end point.

 

Once you’ve created the customer, you may need to add them to the Service Desk, depending on your current customer sharing settings. https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/servicedesk/{serviceDeskId}/customer

 

You can then raise a request on behalf of the user: createCustomerRequest https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/request-createCustomerRequest

 

Hope this helps!

 

Cheers,

Keri

@Keri 

 

In regards to 

You can then raise a request on behalf of the user: createCustomerRequest https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/request-createCustomerRequest

What argument do I use to specify the customer?

I would also need to know this.

You can't adress the reporter field and there also seems to be no field like "customer" or any information about how to set this via the SD-API

Hello bud!  Just set "raiseOnBehalfOf" field to the costumer that you want.

 

{
"serviceDeskId": "1",
"requestTypeId": "1",
"requestFieldValues": {
"summary": "Request JSD help via REST",
"description": "I need a new *mouse* for my Mac"
},
"raiseOnBehalfOf": "qm:a58be9bc-77cb-469a-969f-4a31bc08b487:83694b75-5714-45d8-b5ca-f16344d217ec"

}

 

Like Jonathan likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Security Advisory for Jira Service Management

On October 20, 2021, Atlassian published a security advisory for Jira Service Management. The full advisory is available at this link.  We've seen a number of questions already asking for...

241 views 1 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you