Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-28104

Rest GET request to use standard time formatting or provide useful error messages

XMLWordPrintable

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

      It seems that REST requests require time codes as the following for example:

      2012-05-05T01:01:01.123+1000
      

      The following time codes do not work:

      2012-05-05T01:01:01
      2012-05-05T01:01:01Z
      2012-05-05T01:01:01+1000
      2012-05-05T01:01:01.123
      2012-05-05T01:01:01.123Z
      

      The failed response headers:

      Request URL:http://localhost:5003/rest/api/2/issue/HSP-2/worklog
      Request Method:POST
      Status Code:500 Internal Server Error
      Request Headersview source
      Accept:*/*
      Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
      Accept-Encoding:gzip,deflate,sdch
      Accept-Language:en-US,en;q=0.8,en-AU;q=0.6
      Connection:keep-alive
      Content-Length:59
      Content-Type:application/json
      Cookie:remember=localadmin:7:6ed34746f5098e7289fbe02c9daad8db; crucibleprefs1="D%3D1331875449435"; jira.conglomerate.cookie=; doc-sidebar=283px; confluence.browse.space.cookie=space-blogposts; AJS.conglomerate.cookie="|upm.tab=manage"; gh.i=%7B%7D; JSESSIONID=287BF7E26194C9779CFD98C334C6F0A7; atlassian.xsrf.token=AG87-S37R-QM8W-6VWE|cf47098c9c82f06c08660286b925763668dd762a|lin; __utma=1.1602233020.1335846110.1336345641.1336351466.5; __utmc=1; __utmz=1.1335846110.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
      Host:localhost:5003
      Origin:chrome-extension://cokgbflfommojglbmbpenpphppikmonn
      User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19
      Request Payload
      {"started": "2012-05-05T01:01:01+1000", "timeSpent": "5m"}
      Response Headersview source
      Cache-Control:no-cache, no-store, no-transform
      Connection:close
      Content-Type:application/json;charset=UTF-8
      Date:Mon, 07 May 2012 01:22:50 GMT
      Server:Apache-Coyote/1.1
      Transfer-Encoding:chunked
      X-AREQUESTID:682x95x1
      X-ASESSIONID:7gl0gd
      X-AUSERNAME:test
      X-Seraph-LoginReason:OK
      

      The failed response:

      {"errorMessages":["Internal server error"],"errors":{}}
      

      An internal server error here doesn't help with understanding that the timecode is incorrect. This should return a more descriptive error, or support the ISO 8601 standard.

      To reproduce:

      Use the Google Chrome REST Console, enter request URI, eg:

      http://localhost:5003/rest/api/2/issue/HSP-2/worklog
      

      Request method: POST
      Content-Type: application/JSON
      RAW body, eg:

      {"started": "2012-05-05T01:01:01+1000", "timeSpent": "5m"}
      

              Unassigned Unassigned
              mandreacchio Michael Andreacchio
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: