Uploaded image for project: 'Atlassian Marketplace'
  1. Atlassian Marketplace
  2. MP-73

REST API parses date/time strings poorly

    XMLWordPrintable

Details

    • 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.

    Description

      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"

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: