JetBrains / YouTrackSharp

.NET Standard 2.0 Library to access YouTrack API.
https://www.jetbrains.com/youtrack
Apache License 2.0
134 stars 105 forks source link

Is support for Markdown in text custom fields on the roadmap? #101

Closed apuchkov closed 3 years ago

apuchkov commented 3 years ago

Hello,

We have a Release Notes custom text field in YouTrack. We pull it via API to display in the external release notes generator app.

The issue we came across is that there's no way to get markdown text converted to HTML using YouTrackSharp client.

YouTrack API itself returns markdown text transformed to HTML when requested. For a example a request like this: http://youtrackurl/api/issues/AB-2420?fields=$type,id,summary,customFields($type,id,projectCustomField($type,id,field($type,id,name)),value($type,avatarUrl,buildLink,color(id),fullName,id,isResolved,localizedName,login,minutes,name,presentation,text,markdownText)) returns markdownText property:

        {
            "projectCustomField": {
                "field": {
                    "name": "Release Notes",
                    "id": "30-39",
                    "$type": "CustomField"
                },
                "id": "201-10",
                "$type": "TextProjectCustomField"
            },
            "value": {
                "id": "text",
                "text": "n/a - internal\n**testing markdown**\nList:\n- item 1\n- item 2",
                "markdownText": "<div class=\"wiki text common-markdown\"><p>n/a - internal<br/><strong>testing markdown</strong><br/>List:</p>\n<ul class=\"wiki-list0\">\n<li>item 1</li>\n<li>item 2</li>\n</ul>\n</div>",
                "$type": "TextFieldValue"
            },
            "id": "201-10",
            "$type": "TextIssueCustomField"
        }

I tried to use a few other markdown libraries to manually convert markdown to HTML, but they produce a different result than YouTrack.

Please let me know if exposing markdownText property is in the roadmap.

Alex

maartenba commented 3 years ago

This is all the "new" YouTrack API, and YouTrackSharp still uses the previous API. We're currently looking at updating the library to use it, but no ETA yet.

rekolobov commented 3 years ago

Fixed in 2021.3.1 by introducing wikifyContents parameter for GetIssue* methods, although migration described in 2021.3.0 would be required