Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,802
Community Members
 
Community Events
184
Community Groups

Using smart values within regular expression

Problem:

  • I am trying to evaluate an automation rule which uses regular expression and was wondering if I can insert a smart value to be evaluated as part of the regex.
  • Trying to ensure the ticket's summary that is created matches the format needed including current date, trying to pull it from a smart value.

 

Steps taken to solve:

  • Basic testing by triggering the rule and seeing if it will be evaluated.
  • Checking documentation to see if what I'm trying to do is/isn't possible.

 

Regex string being evaluated:

\w{3}-\w{7,12}-(EKS|ECS|Lambda|Dynamodb|DynamoDB)-\w+-{{issue.created.format("mmddyyyy")}}-\d{1,2}

 

 

If anyone is able to find some documentation about this it'd be appreciated!

1 answer

1 accepted

1 vote
Answer accepted
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.
Apr 30, 2023 • edited

Hi @Josiah Brown -- Welcome to the Atlassian Community!

Often the challenge is when there are nested quotation marks, as it seems you are trying: one set for the format() and another wrapping the regular expression.

I believe a work-around is to create the regular expression as a variable using Create Variable, and reference that as the expression.  For example: match(varMyCreatedVariableName)

And also...the regular expression parser is documented as based upon the Java one, and there are several posts showing it does not match.  When using a more complex expression, I recommend testing your expression by building it up in pieces, including a hard-coded date value, to confirm it works as you expect.

Kind regards,
Bill

Good morning Bill,

 

Thank you for the welcome and your help!

 

I only have one set of quotations for my regex and that is for the format(). I'm not too familiar with your workaround but you think it'll allow my regex to contain the smart value I've provided? Very interesting.

I know the rest of my regex works and I've tested the portion with the date using some regex with just \d{6} so it's just the question as to if you can pair smart values inside of regex.

One workaround is to add a step to do simple matching and see if the summary contains {{issue.created.format("mmddyy")}}

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.
Apr 30, 2023

I thought you were trying to use this regular expression in an automation rule, in which case the entire expression would be enclosed in quotation marks...unless it is already in a created variable.

If not in a rule, how are you using this regular expression?

Suggest an answer

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

Atlassian Community Events