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

Specific text field format broken when using the Jira Cloud API v3 Get Issue and Edit Issue endpoints

    XMLWordPrintable

Details

    Description

      Issue Summary

      The issue is about specific text field formats that are not well-supported by the API v3, e.g. "# Default checklist\n--- Header". Editing an issue with v2 of the Edit Issue endpoint and retrieving information with the v2 of Get Issue endpoint works as demonstrated bellow:

      "fields": { "description": "# Default checklist\n--- Header",

      Visualizing the response with v3 of the endpoint works correctly, in ADF format.

      However, editing the issue with v3 of the Edit Issue endpoint, and fetching the results with v2 of the Get Issue endpoint the results show a different format breaking the expected format:

      "fields": { "description": "# Default checklist\n#* \n#** Header",

      Steps to Reproduce

      1. Perform a request to the v2 of the Edit Issue endpoint with the following JSON body description: 
        {
          "fields": {
        	"description": "# Default checklist\n--- Header"
        	}
        } 
      1. Fetch the issue information with v2 of the Get Issue endpoint the result is as expected: 
        "fields": {
        	"description": "# Default checklist\n--- Header", 
      • Perform the request to the v3 of the Edit Issue endpoint, the result is as follows: 
        "fields": {
            "description": {
                "version": 1,
                "type": "doc",
                "content": [
                    {
                        "type": "orderedList",
                        "attrs": {
                            "order": 1
                        },
                        "content": [
                            {
                                "type": "listItem",
                                "content": [
                                    {
                                        "type": "paragraph",
                                        "content": [
                                            {
                                                "type": "text",
                                                "text": "Default checklist"
                                            }
                                        ]
                                    },
                                    {
                                        "type": "bulletList",
                                        "content": [
                                            {
                                                "type": "listItem",
                                                "content": [
                                                    {
                                                        "type": "paragraph",
                                                        "content": []
                                                    },
                                                    {
                                                        "type": "bulletList",
                                                        "content": [
                                                            {
                                                                "type": "listItem",
                                                                "content": [
                                                                    {
                                                                        "type": "paragraph",
                                                                        "content": [
                                                                            {
                                                                                "type": "text",
                                                                                "text": "Header"
                                                                            }
                                                                        ]
                                                                    }
                                                                ]
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
      • Go to the UI of the issue, and reset the description in the issue. Then edit the issue with the v3 of the Edit Issue endpoint, using the exact value that we got in the previous step 3.
         
      • Fetch the information of the issue using v2 of the Get Issue endpoint, and the result has a different format: 
        "description": "# Default checklist\n#* \n#** Header" 

      Expected Results

      "description": "# Default checklist\n--- Header"

      Actual Results

      "description": "# Default checklist\n#* \n#** Header"  

      Workaround

      Using v2 of the endpoints returns the value with the format needed:

      "description": "# Default checklist\n--- Header" 

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              d6427b6fb657 Guilherme Bueno
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated: