• 1
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.

      Problem:
      The JIRA REST API is peculiar and picky about date and time strings. It's almost ISO 8601 compliant, but slightly different:

      • It demands time zone offsets in the form [+-]hhmm instead of the ISO format, [+-]hh:mm.
      • It fails to parse if there is no fractional seconds, even if that fraction is 0 (e.g. 2016-06-08T23:44:57+0000 is not accepted while 2016-06-08T23:44:57.00+0000 is).

      These differences, while subtle, break compatibility with standard date/time libraries, requiring the user to "fix up" library-provided strings before POSTing them to JIRA. Even worse, instead of returning HTTP 400 and indicating the error as some message (as the API docs say JIRA should), POSTs to /rest/api/2/issue/{issueIdOrKey}/worklog (and possibly other endpoints) return HTTP 500 if JIRA is unsatisfied with the date, giving no indication of what went wrong.

      To Reproduce:
      POST to /rest/api/2/issue/{issueIdOrKey}/worklog to a "started" value of some ISO 8601 date and time, e.g. 2016-06-08T23:44:57+00:00

      Desired Fixes:

      1. The JIRA API should accept date and time strings in standard ISO 8601 formats.
      2. When times cannot be parsed, HTTP 400 should be returned instead of a HTTP 500 "Internal Server Error"

          Form Name

            [MP-73] REST API parses date/time strings poorly

            Shocking that Jiracant do valid timestamps.

            Ewan Makepeace added a comment - Shocking that Jiracant do valid timestamps.

            Stefan Kamphausen added a comment - - edited

            Me too.

             

            As a consumer of the API, I'd like to get all timestamps in valid ISO 8601 format, including a colon in the offset. Standard timestamp parsers expect it.

             

            According to this lonely question Jira used to do that before: https://community.atlassian.com/t5/Jira-questions/jira-api-date-time-format-changed/qaq-p/610722

            Stefan Kamphausen added a comment - - edited Me too.   As a consumer of the API, I'd like to get all timestamps in valid ISO 8601 format, including a colon in the offset. Standard timestamp parsers expect it.   According to this lonely question Jira used to do that before:  https://community.atlassian.com/t5/Jira-questions/jira-api-date-time-format-changed/qaq-p/610722

            It is actually worse. I tried to search using createdDate and updatedDate and got following response from JIRA:

            Date value '2020-07-08T09:49:03Z' for field 'createdDate' 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

            It does not support timezones here at all and the format is also a bit different from ISO 8601 / RFC 3339.

            See-also: JRACLOUD-17359
            See-also: JRACLOUD-64103

            Dennis Schridde added a comment - It is actually worse. I tried to search using createdDate and updatedDate and got following response from JIRA: Date value '2020-07-08T09:49:03Z' for field 'createdDate' 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 It does not support timezones here at all and the format is also a bit different from ISO 8601 / RFC 3339. See-also: JRACLOUD-17359 See-also: JRACLOUD-64103

            Sadly this issue still exists

            Vitalii Zurian {Appfire} added a comment - Sadly this issue still exists

              Unassigned Unassigned
              c6b3fef7b130 Matt Kline
              Votes:
              27 Vote for this issue
              Watchers:
              22 Start watching this issue

                Created:
                Updated: