How to get filtered worklogs via Jira API?

Marat Hovsepyan April 12, 2019

I am using Jira api for getting my issue worklogs, but it returns all worklogs.
Is there any way to do some filter?  for example by date.
Currently my request looks like this 

.../rest/api/2/issue/$key/worklog

 Is there any way to put date filter ?

/rest/api/2/issue/$key/worklog?fromDate=2019-04-01

 

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 16, 2019

Hello Marat,

Using the API to access data within Jira is an excellent idea and does allow for significant amounts of data to be returned very quickly. Some endpoints within the API do accept JQL to allow for additional filtering; there are also some that do not allow for JQL statements. The workflow endpoint does not state that JQL statements are permitted. However, there is an endpoint for Search for Issues using JQL which provides an expand option which may allow for worklogs within the issues. You may find this endpoint at GET /rest/api/3/search along with the information on JQL at Advanced searching.

Alternatively, you may still use the endpoints you referenced and use a script to parse out the data the is not relevant to your needs. This will be due to JQL not being available within the endpoint.

I hope this proves helpful and you’re able to GET the worklogs you need.

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer