Forums

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

Jira automation - how to overwrite part of field

Georgina Everett January 16, 2025

I'm using an automation that adds the parent name and then a colon to the front of story summaries when a parent issue is added:

{{issue.parent.Summary}}: {{issue.summary}}

But this means that if someone changes the parent, then we end up with a story summary that has two parents at the front

New parent: Old parent: story summary

How do I create a rule that overwrites the original parent? 

[The current rule won't work if issue creation is the trigger, since you add parent info after issue creation.]

2 answers

0 votes
Bill Sheboy
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.
January 16, 2025

Hi @Georgina Everett -- Welcome to the Atlassian Community!

First thing, what problem are you trying to solve by doing this?  That is, "why do this?" 

Knowing that may help the community to offer better suggestions as replicating the field text could cause problems / confusion (particularly if the rules do not run when expected).

 

Until we know that...

If your Summary field always has that colon as a delimiter and there are never any other colons in issue Summary fields (including the parent), the substringAfter() function could be used:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#substringAfter--String-separator-

For example:

{{issue.parent.summary}}: {{issue.summary.substringAfter(":")}}

 

Kind regards,
Bill

Georgina Everett January 20, 2025

Thanks Bill! I think your suggestion will work for us, so that's great, thank you.

As for 'why do this?', I hope that it will turn out to be unnecessary, but as colleagues get used to Jira, making the parent/epic as obvious as possible will help, especially as we sometimes have very similar tasks that belong to different epics. It also means that it'll quickly become clear to someone who's created an issue and attached it to the wrong thing. 

0 votes
Benjamin
Community Champion
January 16, 2025

Welcome @Georgina Everett ,

 

Haven't encounter a way to just replace or overwrite just portion of the text. Another way to approach it is to possibly create a hidden field that has a copy of the original summary when the issue was created. That way you can do something like this

 

{{issue.parent summary}} {{issue.originalsummary}}

 

There' a probably a good business reason why putting a parent summary is the child summary. I would suggest to seek alternatives other than updating the summary.  Usually, that should be left intact and only state what the ticket is about. There's other ways to see the parent through other Jira boards.

 

 

Georgina Everett January 20, 2025

Thanks Benjamin. As in my response to Bill, above, I think this will be a short-term thing just to make things as easy to find/understand as possible, rather than a long-term action. Really appreciate you taking the time to respond!

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