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

Searching for issues using the REST API, date and time fields appear to be rounding down milliseconds to 000

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 5.0.3, 6.0, 7.0.0, 7.13.0, 8.0.0, 8.5.0, 8.5.7, 8.13.0
    • REST API

    Description

      Summary

      The datetime values of an issue XXX-12334 are different depending upon whether you get them from the REST API endpoint of '/rest/api/2/search?jql=...', or from the endpoint '/rest/api/2/issue/XXX-1234'.

      Steps to Reproduce

      1. Make to REST API GET calls to return the same issue, such as /rest/api/2/search?jql=key=SCRUM-10&fields=updated AND then /rest/api/2/issue/SCRUM-10
      2. Compare dates such as updated or created from these two returned json payloads

      Expected Results

      We expect the values to be exactly the same, because these are the same issue

      Actual Results

      While the /rest/api/2/issue/SCRUM-10 endpoint returns the exact date/time, it appears that the search endpoint /rest/api/2/search is dropping or truncating the fractions of seconds, and always shows .000 regardless of the actual value. It could be seen as Jira rounding down these fractions of a second

      GET request : http://...rest/api/2/search?jql=project=FXO&fields=updated,created
      Response:

      {
      expand: "names,schema",
      startAt: 0,
      maxResults: 50,
      total: 1,
      issues: [
      {
      expand: "editmeta,renderedFields,transitions,changelog,operations",
      id: "24878",
      self: "http://.../rest/api/2/issue/24878",
      key: "XXX-1234",
      fields: {
      created: "2012-05-11T18:18:14.000+0200",
      updated: "2012-05-11T18:18:14.000+0200"
      }
      }
      ]
      }
      

      GET request: http://.../rest/api/2/issue/XXX-1234?fields=updated,created

      Response:

      {
      expand: "renderedFields,names,schema,transitions,operations,editmeta,changelog",
      id: "24878",
      self: "http://.../rest/api/2/issue/24878",
      key: "XXX-1234",
      fields: {
      created: "2012-05-11T18:18:14.734+0200",
      updated: "2012-05-11T18:18:18.210+0200"
      }
      }
      

      Notes

      Workaround

      There is no known workaround for this problem

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              821a3fa7976f Cyril RICHARD
              Votes:
              13 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated: