Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-61378

REST API parses date/time strings poorly

    XMLWordPrintable

Details

    • 2
    • 1
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? 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:
              45 Vote for this issue
              Watchers:
              30 Start watching this issue

              Dates

                Created:
                Updated: