How to get the number of case being logged in Service Desk with API

Valdy February 15, 2019

We are trying to get a number of the case being logged (Service Request/Incident/Problem combined) in Service Desk via API. Something like this BUT not sure on how to do this GET on rest/api/3/search?jql=filter=123 etc etc

We manage to access the basic information via CURL:

curl D -u "XXX@XXXXcorp.com:APITOKEN" -X GET -H "Content-Type: application/json" "https://xxx.atlassian.net/rest/api/3/issue/DCHC01-6330"

Any input will be good.

Thank you

 

1 answer

1 accepted

0 votes
Answer accepted
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 19, 2019

Hi Valdy,

You could use something like the following JQL to get everything created today in your project:

project = Project_Name and created >= startOfDay() 

then use the API results you noted "GET on rest/api/3/search?jql=filter=123 etc etc" there will be a total attribute that contains a count on the issues returned by the filter, EXE from my test instance in the expand section:

{
"startAt": 0,
"maxResults": 50,
"total": 1,
"issues": []
}

So that filter contains 1 issue created today.  The key is to narrow the filter result to return only the values you are looking to get a count on, and some additional details on JQL formatting can be found in  This Documentation, and full break down on startoday() can be seen HERE

Regards,
Earl

Suggest an answer

Log in or Sign up to answer