Skip to content

Jira Issue: Fix comments' datetime

Arturo Herrero requested to merge 324300-fix-jira-issues-comments-datetime into master

What does this MR do?

Jira Issue: Fix comments' datetime. Follow-up from !55221 (merged), details #324300 (comment 528380107). These changes are under jira_issues_show_integration feature flag.

When we query the Jira API, we use renderedFields option to get some values (description and comments) as HTML. That way we can render that information in GitLab.

That way, we can get the Jira Issue data from the Jira API response in two formats: fields and renderedFields.

"fields": {
  ...
  "comment": {
    "comments": [
      ...
          "displayName": "Arturo Herrero",
          "active": true,
          "timeZone": "Europe/London"
        },
        "created": "2021-03-10T10:05:51.199+0000",
        "updated": "2021-03-10T10:05:51.199+0000"
      },
  ...
}
"renderedFields": {
  ...
  "comment": {
    "comments": [
      ...
          "displayName": "Arturo Herrero",
          "active": true,
          "timeZone": "Europe/London"
        },
        "created": "2 days ago 10:05 AM",
        "updated": "2 days ago 10:05 AM"
      },
  ...
}

Using renderedFields we can get some of the following formats:

  • "Just now"
  • "2 days ago 10:05 AM"
  • "24/Feb/21 7:19 AM"

Instead of the datetime with timezone from fields:

  • "2021-03-10T10:05:51.199+0000"

We have to get the datetimes' fields from the fields key as it's more reliable and easy to consume in our end.

Related to #324300 (closed)

Edited by Arturo Herrero

Merge request reports