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:
-
Is there a reliable way to use Jira smart values to update an ADF description field via Automation for Jira in a PUT payload?
-
Are there known limitations or workarounds for injecting smart values into ADF JSON for rich text fields?
-
Is there a way to fetch the ADF JSON of the source description and use it directly in the update payload?
-
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!