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)?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
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.