Hi All,
I am having a problem finding documentation on the right way of doing this.
I am setting an Automation on the Service Desk and my goal is to add a comment during the transition of a ticket. We have set comments mandatory when resolving tickets.
I have other use cases where I have a very similar problem.
I added the following code to the additional fields to modify during the transition:
{
"update": {
"comment": [
{
"add": {
"body": {{CommentBody}}
}
}
]
}
}If the value of {{CommentBody}} is “Nice Work”, the automation runs successfully.
However, If I replace the value of {{CommentBody}} with a Valid ADF Document, then I get the error:
(Operation value must be an Atlassian Document (see the Atlassian Document Format) (comment))
CommentBody is a variable set up in the Automation and is accessible as smartvalue using {{CommentBody }}
For reference, I have used the ADF builder to generate the wanted JSON code, which I pasted as the value of the smartvalue.
Example, for the text:
Hi Ignacio,
We haven't heard back from you for 10 days, so we're automatically closing this support request for now.
Please feel free to re-open or comment on this issue if you still need help!
Best Regards,
Automation for JIRA
The resulting JSON is
{
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Hi Ignacio,"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "We haven't heard back from you for 10 days, so we're automatically closing this support request for now."
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Please feel free to re-open or comment on this issue if you still need help!"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Best Regards,"
},
{
"type": "hardBreak"
},
{
"type": "text",
"text": "Automation for JIRA"
}
]
}
]
}