Forums

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

Problems sending mails to external users in jira Cloud with Script runner

ATsoft
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 6, 2019

Hi

 

I create a Script that works fine to deliver mail to "Internal" Users, but for some reason (i dont know) this is not working for "external" users (i mean users that dont belong to the domain (@internal.com).

I explain better my user andres@external.com doesnt receive a mail via this script, althought i can log on and YES, receive Subscriptions as well. Also If i fire a mail form the system config send mail i receive ok, but not when running the script.

Is it a limitation of something in Jira Cloud / @Script Runner or just my script is incorrect ?

post("/rest/api/2/issue/OIMP-11/notify")
.header("Content-Type", "application/json")
.body([
subject: 'Mail title',
textBody: "Body",
htmlBody: "<p>Body <b>Prueba</b></p> <table style='width:100%'> <tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th> </tr> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr> </table>",
to: [
users: [[
name: "Internal",
active: true
]]
]
])
.asString()

1 answer

0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 26, 2019

Hi Andres,

Thank you for your question.

I can confirm that the reason that you can notify yourself via the script is due to a limitation with the notify rest API which specifies that users are not allowed to notify their own user using the rest API.

We have more information on this inside of our documentation page located here which explains this.

Also I can confirm that as specified in the Rest API documentation page linked above that the API requires a list of Jira users or groups to be sent as paramaters and that you cannot pass a list of emails or just specify all users in the internal user directory. 

If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.

Regards,
Kristian

Suggest an answer

Log in or Sign up to answer