clear-code / tb-redthunderminebird

Modified version of redthunderminebird. Original: https://github.com/arima-ryunosuke/redthunderminebird
Mozilla Public License 2.0
7 stars 3 forks source link

Lost line-breaks of custom text field after update #4

Closed piroor closed 2 years ago

piroor commented 2 years ago

When a text type custom field has a multi-line text as its value, line breaks are lost with the "update" operation unexpectedly, for example: a "Message-Ids" custom field for https://gitlab.com/clear-code/redmine-plugin-email-importer

An example response for an API access https://redmine.example.com/issues/1.json is:

{
  "issue": {
    "id": 1,
    "project": {
      "id": 1,
      "name": "xxx"
    },
    "tracker": {
      "id": 3,
      "name": "xxx"
    },
    "status": {
      "id": 3,
      "name": "xxx"
    },
    "priority": {
      "id": 4,
      "name": "xxx"
    },
    "author": {
      "id": 8,
      "name": "xxx"
    },
    "assigned_to": {
      "id": 6,
      "name": "xxx"
    },
    "subject": "xxx",
    "description": "xxx",
    "start_date": "2022-02-02",
    "due_date": "2022-02-03",
    "done_ratio": 0,
    "is_private": false,
    "estimated_hours": null,
    "total_estimated_hours": null,
    "spent_hours": 1,
    "total_spent_hours": 1,
    "custom_fields": [
      {
        "id": 8,
        "name": "Message-Ids",
        "value": "AAA\r\nBBB\r\nCCC\r\nDDD\r\nEEE"
      }
    ],
    "created_on": "2022-02-02T00:36:12Z",
    "updated_on": "2022-02-03T04:11:02Z",
    "closed_on": "2022-02-02T07:26:31Z"
  }
}

On such case the "Message-Ids" field should be treated as a multi-line text field.

piroor commented 2 years ago

We can detect the format: