Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Rules it's copy all the JSON body in my custom field

Hender Ruiz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 16, 2023

Hello everyone,

I created a new automation rule to copy the last comment in any issue into a new custom field called "Last comment" using the following structure:

{
"fields": {
"Last comment" :"{{issue.comments.last.body}}"
}
}

The automation rule works, but randomly the rule copy all the JSON structure in the field instead of only the {{issue.comments.last.body}} text

 

Cooments.png

In the image, you can see three comments, the second one works correctly but the other two also get the whole JSON structure

 

Thanks in ahead!

1 answer

1 accepted

1 vote
Answer accepted
Fernando Eugênio da Silva
Community Champion
January 16, 2023

@Hender Ruiz , Welcome to the Atlassian Community!

 

Apparently you are using the 'Additional Fields' section for this.

I believe your automation rule will be more secure if you just use the smartvalue of: {{issue.comment.last.body}} directly in the 'Last comment' field in your automation rule. Select the action 'Edit issue' > Select the field 'Last comment' and insert this smartvalue: {{issue.comment.last.body}}. Have you tried this? Why are you using additional fields section?

Hender Ruiz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 18, 2023

I did follow other answers in the community, but using the Smart Value directly does the trick!!! Thanks!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events