Forums

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

Getting issues created after specified date using REST API and jql (in the API)

Hector Perez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 26, 2019

I am trying to get issues created after a particular date. Currently, if I use jql in the cloud instance, it works. 

For example: project=projectName AND created>2019-02-15, gets the right answer.

However, if I put the following in the API url:

"/rest/api/latest/search?jql=project=projectName&created>2019-02-15" , where

projectName is the project key or the complete name

I get the wrong answer (more issues that I expect):

 

1 answer

0 votes
Andy Heinzer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2019

I would expect the results to be the same whether running the query in the web browser or via a REST API call if it is the same user account making those calls.    Are you using the same user account for the REST API calls that you are using in the web browser?

If not, this could explain the behavior here.  JQL results are not always expected to be the same for all users due to permissions and security profiles Jira can use.  

Since your JQL example is using a the createdDate parameter, my hunch is that the accounts could be using different time zones for the user account profiles, see Manage your Jira personal settings.   If this happens, then it is possible that the Jira site itself is in a different timezone from the user account running the JQL.  What can happen then is that issues created at 11PM Pacific Standard Time are also created at 2AM Eastern Standard Time, which is the next day.  If the Jira system time is on the US East Coast, that issue is technically created the next day, and not the previous day the end user created it.

If you have different user accounts here, I would check the user profiles to better understand the timezones in play here.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events