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

How to Create Ticket in Service Desk using REST API but using a customer username (on Demand)

Steve Giacobbo September 10, 2014

I have used the on demand REST API to create a ticket on my Service Desk using an Agent Username and Password (Basic Authentication over HTTPS).  When I try to create a ticket using the same method, the username and password authentication fail.  Is there, or will there be the ability to use the REST API in On Demand to allow a "customer" to create a ticket?

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Kiernan McColl January 17, 2018

I was also getting 401 Unauthorized for any request to the Jira Service Desk Cloud API using a customer account with basic auth.

I've been able to work around it by using form-based login and then cookie based authentication with the resulting session ID.

This is undocumented/unsupported, so don't rely on it.

First logging in with the customer account credentials, which must be url-encoded:

curl -v 'https://your-domain.atlassian.net/servicedesk/customer/user/login'
-H 'Content-Type: application/x-www-form-urlencoded'
--data 'os_username=USERNAME&os_password=PASSWORD'

There should be a cookie returned in the response headers like this the login was successful:

< set-cookie: local.sd.session.key=your-session-id-here; Expires=Wed, 17-Jan-2018 03:33:37 GMT; Path=/; Secure

Then using the usual documented API call, except with a cookie header rather than Authorization header:

curl 'https://your-domain.atlassian.net/rest/servicedeskapi/request' 
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'cookie: local.sd.session.key=your-session-id-here'
--data <your request data here>
0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 17, 2018

Since it is related. The below change has been implemented in the past few days:

Chris Dell February 20, 2018

@Dario B I'm gettin a 404 on that page, do you have another link?

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 20, 2018
0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 9, 2016

Is is currently not possible because of below bug:

https://jira.atlassian.com/browse/JSD-1473

Please review and watch above bug ticket.

 

Cheers,
Dario 

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events