Hi,
I'm having some difficulties getting to use Jira's Rest API.
I'm currently wanting to jql filter all worklogs for a certain period of time (say from last Monday).
I have been using the following search:
https://myWorkspace/rest/api/2/search?jql=project=MyProject&worklogDate>='2021-10-01'&maxResults=2000&ORDER%20BY%20Created
My idea is that this search returns all issues (I need their key) that had some kind of udpate in their worklog (whether they are old or new issues - cards).
The problem is: even using the exact same worklogDate field that I use in Google Sheets (Jira Clouds for Sheets) to do the date search, it doesn't seem to work. The issues that come keep coming only in order of creation, which makes searching the worklogs very slow (I need to go through issue by issue looking for which ones had some kind of update in their worklog, comparing by the date I want).
I've also tried using the following search type:
https://myWorkspace/rest/api/3/worklog/updated?since=1572442575846
Which theoretically returns me all worklogs of all projects from a certain date.
The problem is that this type of search only returns the ID of each worklog, and I can't access the issue key from it (at least I haven't found how to do this so far). If I could get the issue key, it would be perfect, but just with the worklog ID I don't have enough information to perform other searches.
Basically I need to filter out all the issues that had some kind of worklog update since a certain date.
Does anyone know how to do this?
Hello @mateus.santos
You're using JQL's syntax incorrectly. To include something in a JQL statement, you need to use the word AND, not ampersands. Also, you put the ORDER BY part of the JQL outside the JQL statement too.
The request should be (For ease of reading, I've left the spaces unencoded):
/rest/api/{version}/search?jql=project={key} AND worklogDate>='2021-10-01' ORDER BY created&maxResults=2000
Refer to the JQL documentation for the proper syntax.
Thank you for your help!
I applied the correct syntax (it really makes more sense), but I realize the problem still exists. It even filtered the issues better (they're coming more specifically, rather than all), but older issues (which have been udpate in the worklog recently) aren't coming in the search yet, just the newer ones. I even tested it by removing the "ORDER BY" field, but it made no difference.
Could you say why the oldest issues don't come in this search? (Even with a recent worklog update).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good to hear that you've gotten a grasp of JQL syntax. As for why some 'older' issues with specific worklog dates aren't being found, you've not provided much information.
This is where you'll need to do your own experiments to reduce the problem down and work out what what's causing the search to not include the specific issues you expect.
Start with a Google search of 'jira jql worklogdate range' for other threads by people with similar questions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.