How to get templates for custom email by Script Runner

Arun_Thundyill_Saseendran
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.
December 5, 2014

Hi,

In the default notification scheme there are predefined email templates for issue created, issue updated and so on. They all are file stored in JIRA with the extension '.vm' and they look cool. Unfortunately they are triggered at predefined events. I want to send similar mail when my custom events occur. That is my requirement. How do I do it with script runner?

I searched the web the best I can. i can see snippets but no where there is a template as such. Say for issue created HTMl template. My main requirement is the template similar to the issue modified email that is sent by JIRA, as that requires picking all the modified fields dynamically and printing on screen.

Your help is greatly appreciated!!!

Thanks

Arun

2 answers

0 votes
cyril August 31, 2016

Hi,

 

I would like to create a groovy script that send an email to specific user using the VM email template (velocity)

Then I will add it as Restful endpoint to let the user use this script with their own condition

To give more explaination, some users as an excel file with user that as to be alerted when a new ticket is created, but it depends of specific field condition.

So  the user will develop a script that fit with his requirement,

 I will create a webhook on the creation issue, that will launch this script, and this script will use the Restfull endpoint to send the email to the specific user according to their condition 

As it I will delegate a lot of scripting to the end user.

 

How can I develop the script to use the VM template? what function should i use?

Cyril

0 votes
JamieA
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.
December 8, 2014

But if you just need the standard templates, you can just make sure your workflow function fires some event, and that you have it in your notification scheme. There are two different cases where you might need Script Runner : 1) you have a very custom email template 2) you only want to send mail on a specific circumstance, eg a transition of a high priority issue.

Can you explain more about what you requirement is?

Priyanka Lavania September 14, 2015

Hi Jamie, I have similar requirement, I need to use script post function as under basic notification scheme I do not have any option to add a user in cc, so he is getting a separate email instead of main mail going to DL and he should be in cc. Can you please help on this? Thanks, Priyanka

Carol Jones November 2, 2015

My company also wants to be able to use the JIRA email templates, but include all the users it's being sent to within the To/Cc fields instead of the email being sent to everyone individually. This way each member knows exactly who was sent the email. If there's a way to do this within ScriptRunner (or directly in the JIRA templates), that would be great!

JamieA
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.
November 10, 2015

I'm a bit confused, because in SR they are not send individually. Perhaps you are talking about the plain jira notifications?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events