Issue with date fields

Nazar Vasylyshyn May 2, 2023

Hello! We use the Jira API for external systems. We can import issues (tickets) in the external systems, but we have an issue in one of our client with the date field (Date picker). When the user set for example 08/May/23 in the field and then import the issue, the value will be offset by 1 day, i.e. 07/May/23.

Could be a problem with time zones? I mean that in the user profile one time zone, and on his personal computer another time zone and they are different?

1 answer

0 votes
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2023

Yes. My first guess would be timezones.

Jira stores dates as full date-time values where the time part is "00:00" (midnight). If it gets shifted only an hour earlier, then it becomes the previous day.

Check:

  1. Jira expects these in a normalized timezone, probably UTC. Check that and make sure that you pass them in UTC.
  2. Also, Jira users can choose their own preferred timezone. The value will be displayed in the timezone of the user, also check that.
Nazar Vasylyshyn May 3, 2023

@Aron Gombas _Midori_ Thank you for your response!

1) Could you please clarify a little about that answer?

2) I can check it in the user's profile? Am I right?

Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2023
  1. You wrote "import", but I am not sure which mechanism you meant exactly here:
    1. If it is the CSV import, then you should check in which timezone it expects date values. If it is the REST API, you should check the same.
    2. After you understood the expectation, you should guarantee that your date values meet that. For example, if the external system produces dates in timezone X, but the import mechanism expects them in timezone Y, then you should implement the conversion from X to Y before importing.
  2. Yes. But Jira has its configurable system-wide timezone. If a user doesn't sets his/her own timezone, then he will the system-wide timezone.
Nazar Vasylyshyn May 3, 2023

1) We have an external system, where we can "import" tickets here by calling Jira Rest API and based on the API response, create tickets in an external system. For example, a Jira ticket can have some custom field with Date picker type and value of the custom field, for example, 08/May/23. When we do "importing" aka calling Jira rest API to get all tickets and based on the response data, we create tickets in the external system, as a result, the value of the custom field in the external system will be 07/May/23, i.e. offset by 1 day. We parse the value from a response like:

new Date('08/May/23').toISOString()

Suggest an answer

Log in or Sign up to answer