How to send a mail to a group of users using script runner?

MarcoBaldo May 29, 2013

I would like to send a mail to a group of users in JIRA but I don't know how to set the parameter "To issue fields" to retrive all the users in a group, for example to send an email to all the administrators in the group "jira-administrators".

3 answers

1 accepted

2 votes
Answer accepted
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.
May 29, 2013

You can send emails to members of a group... just set the "To" recipients to: group:jira-administrators

You can also send it to members of a role, user, group and multi custom fields.

MarcoBaldo June 2, 2013

Thank you Jamie, very useful. I have some other question about Script Runner. For example I cannot get precisely what is the "context" (the variables I can get) in the body of an email.

I read something very useful in this guide (https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts) but I would like to know if there is some documentation more.

For example I tried to put this code in the body of a builtin custo email

"EDV Code - Name <% out << issue.getCustomFieldValue(componentManager.getCustomFieldManager().getCustomFieldObject("customfield_10700")) %>"

and in the email i got "EDV Code - Name [null:0035775, 1:Guido Group]"

How can I remove the "null:" and the "1:"?

Anyway the original question i solved, thanks!

And thank you very much also for the script runner tool!


0 votes
Tsol
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.
May 29, 2013

Hey,

at the moment in the built script there is no option to set recipient in a jira group. A workaround is to create a mail group that contains the email of jira group members and set the mail group address as recipient.

A second option is to add every mail address in the post function but i would not suggest that in case that your group has to many members.

Finally you could write your own script that send mail to group.

Possible there are more options.

Hope that helps.

Cheers

Tsol
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.
May 30, 2013

Ooops! Wrong answer here. I haven't noticed the group option. Sorry the mislead.

Cheers

0 votes
Bhushan Nagaraj
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.
May 29, 2013

Are you talking about sending an email in a workflow post-function?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events