Hi There,
I have a rule that comments issues on a cloud instance with the last comment body of the issues of another cloud instance, by sending {{issue.comments.last.body}} through a webhook:
I'm having some issues with special characters, e.g.:
On the receiving instance I'm getting the following:
Any suggestion on how to handle this kind of comments?
Thanks in advance!
Hi @Pablo Serra
Have you tried any of the smart value encoding functions provided by automation before sending the message: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#Encoding
Kind regards,
Bill
Hi Bill, thanks for your reply.
I've contacted support and after a little back and forth, they provided me the following function that did the trick: asJsonString()
In my post:
{ "commentAuthor": "{{ issue.comments.last.author.displayName }}", "commentBody": {{ issue.comments.last.body.asJsonString() }}, "keyBancar":"{{ issue.key }}", "summary":"{{ issue.fields.summary }}", "keyIssues":"{{ issue.fields.customfield_10716 }}" }
Please note that it must be sent without the quotation marks around the curly brackets.
More info about this function:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-json-functions/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
You can also use the json encode function:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#Json-encoding
{{issue.summary.jsonEncode}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is really old, but I've been trying to do the same thing lately and came across this article.
All I want to do is comment on an issue in 1 instance, and have that fire off a message to a webhook in Jira automation, and it add that comment to a linked ticket (via custom field).
From above there was a missing colon, and comma:
{
"comment": {
"id" : "{{comment.id}}",
"body" : {{comment.body.asJsonString()}},
"author" : {
"accountId" : "{{comment.author}}",
"displayName": "{{comment.author.displayName}}"
}
}
}
How do I use an incoming webhook to update a specific issue with this comment from the payload using these smart values?
{{webhookData.comment.body}}
{{webhookData.comment.author.displayName}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apparently the problem are the line breaks. Only comments with line breaks failed to impact on the receiving instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.