• Arturo Herrero's avatar
    Jira Issue: Fix comments' datetime · 6237237f
    Arturo Herrero authored
    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.
    6237237f
issue_detail_entity_spec.rb 5.27 KB