Easiest way to access Jira Service Desk project via REST API

Thomas Fozzi December 18, 2019

Hello

 

I'm setting up a script to automatically retrieve some stats from my Jira Cloud Service Desk project. In the past I saw Jira provides large API support, so I was expecting it would be pretty easy. Somehow it is taking longer than expected and the doc (https://developer.atlassian.com/cloud/jira/service-desk/rest/ ) doesn't seem to help.

First: Authentication

  • I"m using the credentials of a random Jira Service Desk user (a Service Desk Agent)
  • I tried Basic authentication as it looks the best option
  • I'm making my tests with cUrl, but the requests will be done in Javascript 

Second: Path

  • which is the path that must be used for a simple query on a given service desk project (e.g. how many issues in status X from day A to day B) - I saw it should accept JQL queries

Third: Expansion

  • among of the dozens of tests some actually gave me a JSON response, but some tags were not expanded; even after using the expansion parameters specified in the Documentation

 

Any suggestion?

 

Thanks

Thomas

1 answer

0 votes
Thomas Fozzi January 27, 2020

I eventually had it working

 

1) encode the string

"username:password" 

with Base64

2) add the header

"Authorization: Basic <encoded string>" 

to your cUrl command

Suggest an answer

Log in or Sign up to answer