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,554,392
Community Members
 
Community Events
184
Community Groups

Replacement of domain in issue creator's email address not working in Jira automation rule

Edited
Лян Артур
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!
Apr 14, 2023

"I'm trying to use the smart value {{issue.creator.emailAddress.replace(/@.+$/, '@domain.org')}} in a Jira automation rule to replace the domain of the creator's email address. However, the smart value doesn't seem to be working as expected. I'm using this in a rule triggered by issue creation. Can anyone help me troubleshoot this issue?"

 

I see this error in audit log

Error rendering smart-values when executing this rule:
Failed to get value for issue.creator.emailAddress.replace(/@.+$/, '@domain.org'): {{issue.creator.emailAddress.replace(/@.+$/, '@domain.org')}}

1 answer

0 votes
Sebastian Mondry
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 20, 2023

Hey there,

So, replace is for (String, String) https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#replace%28java.lang.CharSequence,%20java.lang.CharSequence%29

If you'd like to utilise regex, then you'll need replaceAll. 
Also, don't forget to escape characters, this should do what you are after -> {{issue.creator.emailAddress.replaceAll("\\@.+", "@domain.org"}}

Лян Артур
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!
Apr 20, 2023

Thank you for your reply, but I got the error

Error rendering smart-values when executing this rule:
Failed to get value for issue.creator.emailAddress.replaceAll("\\@.+", "@domain.org": {{issue.creator.emailAddress.replaceAll("\\@.+", "@domain.org"}}

Suggest an answer

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

Atlassian Community Events