Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-11828

Insight date field showing value incorrectly due to timeshift

XMLWordPrintable

    • 0
    • 1
    • We collect Jira Service Desk 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.

      Issue Summary

      In the Insight Date attribute, it is displayed in UTC time. Even though it's a Date attribute, the time value is also saved in the database with time-shift according to the user and system timezone. When we select a date for an Insight object via the GUI, the value saved in the database is automatically adjusted.

      When the user is trying to update a date attribute via script as 2022-05-01 it is saved in the database as "2022-05-01 00:00:00.0" which is 2022-04-30 in UTC. So insight GUI displays it as 2022-04-30

      Steps to Reproduce

      1. Step 1: Script used without timezone setting for updating the date on insight object:
            def dateFormat = new SimpleDateFormat("dd.MM.yyyy")
            def date = dateFormat.parse("01.05.2022")
            InsightUtil.setAttributeValueOnObject(3968065, 13975, date)
            // setAttributeValueOnObject(objectId, attributeId, attributeNewValue)
        
      1. Step 2 : Insight GUI will display this as  '2022-04-30'

      Expected Results

      Insight GUI should display this as of '2022-05-01'

      Actual Results

      Insight GUI will display this as of '2022-04-30'

      Workaround

      We must provide a timezone setting in the script.
      dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"))

              Unassigned Unassigned
              6f6f0ed1241f Shiwani Choudhary
              Votes:
              5 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: