Forums

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

Replacing Summary

Margaret Medon November 21, 2023

Having difficulty using replace in an automation rule.   Referencing this documentation Jira smart values - text fields   

  • {{issue.summary.replace("Hello","Goodbye")}}

Actual Summary: [PDI-1234] - Testing

Desired Summary: [ER-1234] - Testing 

Attempting:  {{issue.summary.replace("PDI","ER")}}

Produced: 

Error while parsing additional fields. Not valid JSON.

2 answers

1 accepted

1 vote
Answer accepted
Bastien Delourmel (FMX)
Contributor
November 21, 2023

Hi @Margaret Medon

 

Could you give us more details regarding your automation?

It worked well for me...

Screenshot 2023-11-21 TEST.png

Margaret Medon November 22, 2023

Thank you for responding, this is the complete rule in my sandbox. 

Screenshot 2023-11-22 at 9.59.01 AM.png

 

I am pretty confident my issue is the Edit Issue step because when I replaced the JSON with: 

{ "fields": { "summary": "woohoo! a new summary" } }

 

it worked.?

Bastien Delourmel (FMX)
Contributor
November 22, 2023

Hey, why don't you select the field "Summary" instead of using the advanced function? As you are using a smart value :)

smartvalue.png

Like Margaret Medon likes this
David Friedrich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2023

@Margaret Medon 

in additional fields it needs to look like this (worked for me):
{
"fields": {
"summary": "{{issue.summary.replace("PDI","ER")}}"
}
}

 

But I agree with @Bastien Delourmel (FMX) . Much easier his way.

Like # people like this
Margaret Medon November 22, 2023

Awesome!   I didn't know that I could solve the problem using his suggestion. Thank you both so much! 

0 votes
David Friedrich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2023

Just to verify: You are certain "[PDI-1234] -" is part of the summary field value? Looks to me like that combination of issue.key and summary.

Margaret Medon November 22, 2023

Yes!  the PDI # is an external number captured by an integration.

Thanks for the follow-up.

Like David Friedrich likes this

Suggest an answer

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

Atlassian Community Events