Search for specific text string in Summary & copy to custom ID field

Luke
Contributor
February 23, 2024

Problem: Half the biz uses the Summary field to add a specific ID, let's call it 'Screen ID'. The other half uses the Screen ID field proper (but not Summary). Both have valid arguments and we cannot align perfectly, so we want to keep both in sync if possible.

Idea: When an ID with a specific format gets added to the Summary, IF the Screen ID field is empty, THEN run an automation to copy [SPECIFIC STRING] and paste into the Screen ID field.

A string would be in the format of something like:

123-456

013-752

etc

But might appear mid-way through a Summary e.g.

Found a bug bla bla 100-020 bla bla bla

 

2 answers

1 accepted

2 votes
Answer accepted
Luke
Contributor
February 26, 2024

This seems to work:

{{issue.summary.match("(\d{3}-\d{3})")}}

A bit simple / rough around the edges but good enough for what we need for now!

Will post any updates here as I refine the solution. 

1 vote
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.
February 23, 2024

Hi @Luke 

Although you could use automation rules to do this, it is unclear what you mean by the "keep both in sync" part.

First, you would probably need three rules: one triggered on issue created, one on a change to summary, and another triggered on a change to your Screen ID field.  The screen ID value could be extracted from the summary using the match() function with a regular expression, or text functions for substrings.  Some of the rules will need conditions to decide what to do for mismatches of values.  And then field edits could set the values.

But...what does "sync" mean if the values are different?  If there are different thoughts from people on which approach to use to enter the values, there will likely be different opinions on how to sync.  Perhaps figure that out before automating anything.

Kind regards,
Bill

Luke
Contributor
February 26, 2024

Hi Bill, thanks – I've since figured out a solution that's "good enough" for us for now which I'll post as a separate answer. (I tried to post after submitting the topic last week but Atlassian wouldn't let me post a reply right away). 

Basically yeah, I've added a RegExp to copy the string from the Summary and paste it into the Screen ID field. There are some quirks so if I update it I'll post updated here too. 

Thanks for your guidance. 

Suggest an answer

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

Atlassian Community Events