The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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