Forums

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

Send email to several users

Maro Hamamjyan
Contributor
June 23, 2019

Hello,

I need to send email to users who are in a group user picker filed. The users can be changed. What API should I use to accomplish this?

 

Thanks in advance 

 

1 answer

0 votes
Alexey Matveev
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.
June 23, 2019

Hello,

You would need a scripting app for it. You could use such appss as Power Scripts, ScriptRunner, Automation for Jira. All apps are different in API, that is why I can not give examples for all plugins.

But if you have the Power Scripts add-on, then your code would look like this:

sendEmail("projectmanager", {#{Your group field anem}}, "Transition executed", currentUser() + " has executed a transition");

 You can find more info here:

https://confluence.cprime.io/display/SIL/sendEmail

Maro Hamamjyan
Contributor
June 23, 2019

 Hello Alexey,

I prefer to use API, can you help with that?

Alexey Matveev
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.
June 24, 2019

Which API?

Maro Hamamjyan
Contributor
June 24, 2019

I tried this one:  

POST /rest/api/2/issue/{issueIdOrKey}/notify

Maro Hamamjyan
Contributor
June 24, 2019

I get this error: (Approvers is several user picker field in JIRA, not in AD) API2.JPG

Alexey Matveev
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.
June 24, 2019

I think you would need to develop a program using Jira Rest Api. First get the value of the field for the required issue: https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/?&_ga=2.146847351.1131713726.1561299576-1149622764.1547637396#api/2/issue-getIssue

and then use the notify rest method to send a email.

Suggest an answer

Log in or Sign up to answer