•  
      request #24219 Html format link sent by api request in text field bad display in report page
    Infos
    #24219
    nico (nguedon)
    2021-12-14 10:35
    2021-12-14 09:48
    25762
    Details
    Html format link sent by api request in text field bad display in report page

    Hello,

    Looks like there is a bug in rest api when we send a "html" format link in a text field to update an artifact. In the column of report, the html is displayed in plain text (despite the field is a text field, the one that has format html/commonmark possibility, not a string field)

    In the artifact itself the value is well displayed as html link. If we update the field by Webgui (by changing the style to html). The field is well displayed.

    Looks like the parameter format "html" is not taken into account in api rest update. (if we choose common mark, its also displayed as plain text instead of link in the report)

    This bug has a big impact on report part display.

    In attachment some explanation with screen capture.

    Below example of the value sent by api rest (update put to an artifact): { "values": [ { "field_id": 40038, "value": "

    <a href="xxxURL_LINKxxx/?aid=27583">#CID27583

    \n", "format": "html" } ] }
    Trackers
    13.2
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    Closed
    2021-12-14
    Attachments
    (86 kB)
    explanation of the bug with different steps
    References
    References list is empty

    Follow-ups

    User avatar
    Thomas Gerbet (tgerbet)2021-12-14 10:35
    • Status changed from Waiting for information to Closed
    • Close date set to 2021-12-14
    User avatar
    nico (nguedon)2021-12-14 10:32

    I confirm the format is working, so i will use this format.

    But in api/rest when we download the content of an artifact for this kind of field we have: { "field_id": 40038, "type": "text", "label": "Common ID", "value": "

    <a href="xxxURLxxx/api/plugins/tracker/?aid=27583">#CID27583

    \n", "format": "html", "commonmark": "

    <a href="xxxURLxxx/api/plugins/tracker/?aid=27583" target="_blank">#CID27583

    " }

    So i though using the same format was good.

    Thanks, you can close my issue.

    User avatar
    Thomas Gerbet (tgerbet)2021-12-14 10:22

    Hello,

    This does not match the expected format for the text field. Try with something looking like this:

    {
      "values": [{
        "field_id": 40038,
        "value": {
             "content": "<p><a href=\"xxxURL_LINKxxx/?aid=27583\">#CID27583</a></p>\n",
             "format": "html"
         }
      }]
    }
    

    • Status changed from New to Waiting for information