Forums

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

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

Лян Артур
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!
April 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.
April 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!
April 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