Want to check the email addtess of the recipient in my JIRA and based on the email if the email contain "ext" that is external email id , i need to print the comment in the notification. If otherwise Email should only contain JIRA ticket link as internal user can access it via that link.
I am new to this velocity templates but
$recipient.getEmail() will return a string ? Can I compare it? Is there proper APIs where I can learn and test these templates?
$recipient.getEmail() should return a string, from memory. That means you should be able to use $recipient.getEmail().toLowerCase().contains("ext")
Bear in mind that you probably need to be a bit more clever than that though - what happens if you work with users who have emails like Dave.Nexte@yourplace.com ? (I'd reach for regular expressions and use "match" instead of "contains", but I'll leave that up to you)
Yes, I guess regular expresssion will be better option than simple string "contains" check. I have written a comment_if_ext.vm in ..templates/email/text/includes directory. which has contents like,
##Address is $recipient.getEmail()
## Sending notification to internal users
Retrieve comment by using URL from summary below.
I am parsing this in other .vm files like issueCommented.vm by adding this comment in the script.
But This simple logic is not working, is there anything else I need to do inorder to execute it? Is there some other dependency I dont know of.
PS: I have changed velocimacro.library.autoreload=false-->true so that i dont have to restart JIRA to reload the scripts.
Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot