Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-77436

Provide a public REST API endpoint to convert between ADF, HTML, Markup and Markdown now that pf-editor-service has been decommissioned

    XMLWordPrintable

Details

    • Suggestion
    • Status: Gathering Interest (View Workflow)
    • Resolution: Unresolved
    • Ecosystem
    • None
    • 1
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Status Update

      A slightly outdated version of the code is available in the public atlaskit repo:

      You can give it a try since for now it is not granted that an official endpoint will be released.

      Example:

      import { defaultSchema } from '@atlaskit/adf-schema';
      import { JSONTransformer } from '@atlaskit/editor-json-transformer';
      import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
      
      const jsonTransformer = new JSONTransformer();
      const markdownTransformer = new MarkdownTransformer(defaultSchema);
      
      const markdownDocument = '';
      const adfDocument = jsonTransformer.encode(markdownTransformer.parse(markdownDocument));
      

      Summary

      As written in the below thread in the Atlassian Community, up until some time ago there used to be the api https://api.atlassian.com/pf-editor-service/convert?from=xxxx&to=xxx for converting Markdown, Markup, HTMl, etc  to Atlassian Document Format and vice-versa:

       

      By using this endpoint you could easily convert formats as described in below table:

       

      This endpoint was not documented and therefore not supported stopped and it was decommissioned around the beginning of September. It would be nice to get an official endpoint customers can use to easily convert among formats.

      Workaround

      If you need to convert from ADF to HTML you can use the following workaround:

      • To get the comment body returned as HTML call the GET /rest/api/3/[ISSUE KEY or ID]/comments endpoint and append ?expand=renderedBody to it:
        https://NAME.atlassian.net/rest/api/3/issue/{ISSUE-KEY_OR_ID}/comment?expand=renderedBody
        
      • To get the issue description returned as HTML use the  /rest/api/3/issue/{issueIdOrKey}  endpoint followed by ?expand=renderedFields:
        https://NAME.atlassian.net/rest/api/3/issue/{ISSUE-KEY_OR_ID}?expand=renderedFields
        

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            dbonotto Dario B
            Votes:
            18 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

              Created:
              Updated: