"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
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"}}
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"}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.