Forums

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

JQL updateDate querying breaks for time range 01:xx

DM April 25, 2018
When I issue a GET request for updateDate > 2018-03-25 01:15, the query breaks.
I keep getting the error message that the date is in the wrong format (inspite of being in the correct format)

But when I send in the request as updatedDate > 2018-03-25 02:15 it works fine. Same date format for both requests.

In fact the REST calls break only for the time range 01:00 - 01:59

My request is as follows :

/rest/api/2/search?jql=issuekey+IN+%28ITS-109102%29%26updatedDate+%3E%3D+%272018-03-25%2001%3A17%27

2 answers

1 accepted

0 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2018

Are you making this call to Jira Cloud or Jira Server site?

I was not able to replicate this when making a REST call to this endpoint to Cloud, but in Server, I was only able to do this when I was manually entering in %20 for space, and %27 for '

When I actually used a format like this:

/rest/api/2/search?jql=project%3DSCRUM%26updatedDate%3E%3D'2018-03-25%2001%3A17'

I was able to make this call correctly.   So perhaps it's in the syntax of the way the text is being parsed out.   If this doesn't help, could you let us know more about the response you get back, is this listed as an HTTP 400 error (bad request)?

DM April 30, 2018

Hi Andrew,

Thank you for your answer.

I tried replacing the characters as suggested. My Query string now looks like this :

/rest/api/2/search?jql=issuekey%20IN%20%28PROJ-5581%29%26updatedDate%3E%3D'2018-03-25%2001%3A17'&&fields=status,updated,summary

The updated date part in the String resembles what you stated 

updatedDate%3E%3D'2018-03-25%2001%3A17'

 The error message that I get is still the same - 

[Date value '2018-03-25 01:17' for field 'updatedDate' is invalid. Valid formats include: 'yyyy/MM/dd HH:mm', 'yyyy-MM-dd HH:mm', 'yyyy/MM/dd', 'yyyy-MM-dd', or a period format e.g. '-5d', '4w 2d'.]

I am using Jersey (com.sun.jersey.api.client) to make these REST API calls. Any idea why it still breaks?

 

Thank you for your time!

 

Kind Regards

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2018

I tested in Jira Cloud using curl to make this request.   For Server, I also tested with curl, but I was also able to test using the plugin REST API Browser.   I am not certain how or why using Jersey to make this call could be causing problems here.   But I think it might help to try to reduce the query to it's simplest form that still fails, such as:

/rest/api/2/search?jql=updatedDate%3E%3D'2018-03-25'

and then try this same query using different methods to see if we can better understand why this might be happening.

 

Could you try this without the time element to see if that is the problem here?  I suspect that it might not be parsing down the %20 to be a space character as it should be.   OR the %3A that represents the colon :

Since you see a message that indicates 'time is invalid', I suspect the value contains spaces or other characters that are not being parsed out correctly somehow via the REST calls you are making.

DM May 1, 2018

It's strange that the only time period that has an issue is 01:00 - 01:59. So basically, when there is a <Date><White Space><Hour:Time>, the query breaks only when its

<Date><WhiteSpace><01:...> and works fine for 

<Date><WhiteSpace><02:...>

<Date><WhiteSpace><23:...>

updatedDate+%3E%3D+%272018-03-25%2001%3A17%27 - Breaks (01:17)

updatedDate+%3E%3D+%272018-03-25%2002%3A17%27 - Works (02:17)

I tried replacing the query string as you suggested and its the same result

updatedDate%3E%3D'2018-03-25%2001%3A17'

 

It's the white space before the 01 that's causing the issue, as it works for all other time periods. I have tried with both + and %20 for the white space. It gives the same error.

Date value '2018-03-25 01:17' for field 'updatedDate' is invalid.

 

Not sure how to proceed from here. Thank you for your time and help.

 

Kind Regards

DM May 1, 2018

Hi, 

 

Just an update, what finally worked for me was :

 

jql='issuekey+IN+(ITS-109)&&updatedDate>=2018-03-25+01:17'

 

Thank you once again

DM May 1, 2018

A further note to add. This only happens for DST start dates btw.

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 1, 2018

Weird.  I am starting to wonder if there is something special about that specific date/time.  Are you by chance in Europe?  I just learned that this specific date, 25th March 2018 was the beginning of daylight savings time (DST) per https://www.timeanddate.com/news/time/europe-starts-dst-2018.html

In which case, if time springs forward at 1AM, there might not actually be a valid time between 1:00-1:59, since the clocks all jumped ahead one hour exactly at 1AM.   That at least makes some sense to me as to why this only happens during the 1AM minutes, and not for other values. 

DM May 2, 2018

Yes, that was exactly the issue. The Jira Server instance was in BST and hence kept throwing an error for this window alone.

Managed to resolve this by applying the Jira timezone, converting the date and the applying the calls with the converted date.

 

Thank you for your help

0 votes
Robert Cowham
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!
April 2, 2019

Had a similar problem - have a script was looking for issues changed every N seconds which suddently stopped working:

 

RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={}, errorMessages=[Date value '2019/03/31 02:00' for field 'updated' is invalid. Valid formats include: 'yyyy/MM/dd HH:mm', 'yyyy-MM-dd HH:mm', 'yyyy/MM/dd', 'yyyy-MM-dd', or a period format e.g. '-5d', '4w 2d'.]}]}

I tweaked the time requested to be '2019/03/31 03:00:00' and all was well.

JIRA obviously considers the time to not exist and thus it is an invalid format - the problem is less the error, but instead the unhelpful error message...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events