Jira Automation: 400 Error When Updating Description Field with ADF and Smart Values in PUT Payload

I’m trying to automate the synchronization of Jira issues between two Jira Cloud instances using Automation for Jira. My goal is to update an array of fields by replacing their values, and to append (not overwrite) labels. The main challenge is updating the description field, which uses Atlassian Document Format (ADF) for rich text.

What I’m Trying to Achieve:

  • Replace various fields on the target issue.

  • Append all labels from the source issue to the target issue (without overwriting existing labels). (labels part works!)

  • Overwrite the description field on the target issue, preserving rich text formatting (ADF).

What I’ve Tried:

  • For the POST (issue creation) payload, using ADF for the description field works perfectly.
{
  "fields": {
    "project": { "key": "SCC" },
    "issuetype": { "name": "Story" },
    "summary": "{{issue.summary}}",
    
    "reporter": {
      "accountId": "712020:64921a83-74ae-4d39-993a-0ffedc3a295b"
    },
    "customfield_10254": {
      "id": "712020:64921a83-74ae-4d39-993a-0ffedc3a295b"
    },
    "customfield_10001": "a3e59c5c-98ec-4251-a5c4-d47ad5867302",
    "parent": { "key": "SCC-1872" },

    "labels": ["OWL"],
    "description": {
      "type": "doc",
      "version": 1,
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "{{issue.description}}"
            }
          ]
        }
      ]
    },

    "customfield_10266": {
      "type": "doc",
      "version": 1,
      "content": [
        { "type": "paragraph", "content": [ { "type": "text", "text": "{{issue.customfield_10916}}" } ] }
      ]
    },
    "customfield_10232": {
      "type": "doc",
      "version": 1,
      "content": [
        { "type": "paragraph", "content": [ { "type": "text", "text": "{{issue.customfield_10917}}" } ] }
      ]
    },
    "customfield_10242": {
      "type": "doc",
      "version": 1,
      "content": [
        { "type": "paragraph", "content": [ { "type": "text", "text": "{{issue.customfield_10918}}" } ] }
      ]
    },
    "customfield_10233": {
      "type": "doc",
      "version": 1,
      "content": [
        { "type": "paragraph", "content": [ { "type": "text", "text": "{{issue.customfield_10919}}" } ] }
      ]
    },
    "customfield_10231": {
      "type": "doc",
      "version": 1,
      "content": [
        { "type": "paragraph", "content": [ { "type": "text", "text": "{{issue.customfield_10920}}" } ] }
      ]
    },
    "customfield_10230": {
      "type": "doc",
      "version": 1,
      "content": [
        { "type": "paragraph", "content": [ { "type": "text", "text": "{{issue.customfield_10921}}" } ] }
      ]
    },
    "customfield_10241": {
      "type": "doc",
      "version": 1,
      "content": [
        { "type": "paragraph", "content": [ { "type": "text", "text": "{{issue.customfield_10922}}" } ] }
      ]
    },

    "customfield_10244": [{ "value": "{{issue.customfield_10923.value}}" }],
    "customfield_11079": "{{issue.key}}",

    "customfield_11078": {
      "type": "doc",
      "version": 1,
      "content": [
        {
          "type": "paragraph",
          "content": [
            { "type": "text", "text": "{{issue.customfield_10520}}" }
          ]
        }
      ]
    }
  }
}
  • For the PUT (issue update) payload, I’m using the following structure:
{
  "fields": {
    "summary": "{{issue.summary}}",
    "description": {
      "type": "doc",
      "version": 1,
      "content": [
        {
          "type": "paragraph",
          "content": [
            { "type": "text", "text": {{issue.description.jsonEncode}} }
          ]
        }
      ]
    }
  },
  "update": {
    "labels": [
      {{#issue.labels}}
        { "add": "{{.}}" }{{^last}},{{/}}
      {{/issue.labels}}
    ]
  }
}
  • When I use a static value for the description text, the update works.

  • When I use the smart value ({{issue.description}} or {{issue.description.jsonEncode}}), I consistently get a 400 error:
    {"errorMessages":["There was an error parsing JSON. Check that your request body is valid."]}

  • Label section works (finally).

  • I have tried logging the smart value output, using .jsonEncode, and providing a default value for empty descriptions, but the error persists.


Questions for the Community:

  1. Is there a reliable way to use Jira smart values to update an ADF description field via Automation for Jira in a PUT payload?

  2. Are there known limitations or workarounds for injecting smart values into ADF JSON for rich text fields?

  3. Is there a way to fetch the ADF JSON of the source description and use it directly in the update payload?

  4. Any other best practices for handling ADF and smart values in cross-instance Jira automation?


Additional Context:

  • Both Jira instances are Cloud.

  • The automation is triggered by a field change and uses a web request to update the target issue.

  • The description field is rich text (ADF).

  • I want to avoid overwriting labels, only append.

Any help or pointers would be greatly appreciated!

Hello @WendyQuon

You haven’t said which specific API endpoints you are make these requests to, but based on what you’ve described regarding ADF, I’m going to guess you’re using the v3 endpoints.

Only the v3 API endpoints mandate the use of ADF. If you use the corresponding v2 endpoints, you can format your description field using plain text (returned from a smart value etc) or Jira’s traditional wiki markdown format instead.

PS. Generally speaking, questions regarding Jira Automation are not discussed on this forum, as they are considered to be related to just using Jira’s built-in functionality. Such questions are best asked in the Jira section of the public Community Forum.

PPS. The topic of “I want to build my own cross-instance, issue syncing system” comes up many, many times on that forum, and eventually the answer usually comes down to…

If you really need to sync issues between Jira Cloud instances, then you’re better off buying one of the commercial apps you can find on the Atlassian Marketplace.

Hi Sunny,

I’m using OAUTH, not v3 endpoint as you’ve advised in my other post. The OAUTH API endpoint is required given that the API token is scoped. The credentials are not an issue as I’ve managed to do get 204 No Content returns on simple, static value via PUT method, and I’ve finally resolved the POST method of creating issues for a scoped API token.

The problem I’m receiving is the consistent 400 error whenever I switch from a static value to a smart value {{issue.description}} or {{issue.description.jsonEncode}} and it just dies from there. How do people currently update an issues description value to another jira instance today?! :frowning: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob:

I’m using OAUTH, not v3 endpoint as you’ve advised in my other post.

You seem to be confused about two totally different things.

I strongly recommend that you re-read the OAuth documentation again, especially the Construct the request URL section, which provides a clear example of how to construct a request to one of Jira’s v2 REST API endpoints compared to a v3 REST API endpoint when using OAuth.

To re-iterate the previous big hint

IF YOU REALLY NEED TO SYNC ISSUES BETWEEN JIRA CLOUD INSTANCES, THEN YOU’RE BEST SERVED BY BUYING ONE OF THE COMMERCIAL APPS YOU CAN FIND ON THE ATLASSIAN MARKETPLACE