Send eMail on issue creation with Issue ID to a user in User Custom field?

Jositz, Michael (Allianz SE) July 21, 2011

Hi all,

we have the need that JIRA sends out an eMail with a Text like "Dear <Value of User Custom Field>, an issue with ID: <Value of JIRA Issue ID> has been created for you..." on Issue creation.

The default notification does not work here. What ways are there to implement this? Listeners? Post Function? Maybe already a Plugin existant?

Thanks You! Michi

6 answers

1 accepted

2 votes
Answer accepted
J Thomas
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.
July 21, 2011

Have you tried the Script Runner plugin? There's a built-in post-function to send a custom email and it says the recipient can be a custom field (though I've never used this bit).

https://studio.plugins.atlassian.com/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Sendacustomemail

(NB you'll need to move the post-function below where the issue is created)

This plugin can also fire an event for you https://studio.plugins.atlassian.com/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Firesaneventwhenconditionistrue so maybe that could allow both an Issue Created and a custom event to be fired?

0 votes
Jositz, Michael (Allianz SE) July 21, 2011

Thanks very much for all the great help, the Groovy Runner Plugin did the job absolutely perfect :)!

https://studio.plugins.atlassian.com/wiki/display/GRV/Built-In+Scripts#Built-InScripts-SendCustomEmail

0 votes
Jobin Kuruvilla [Adaptavist]
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.
July 21, 2011

Yes, I am afraid you can't have two events. But what you can do is to catch the issue created event in a listener and dispatch your new event in it using IssueEventDispatcher.

0 votes
Jositz, Michael (Allianz SE) July 21, 2011

@Jobin: Thanks for now, I checked (http://wiki.customware.net/repository/display/ATLASSIAN/How+to+create+a+custom+event+in+JIRA) and find that the New Event is very good but the problem now is that I can only assign one Event to the Workflow. This is a problem because I need the "Issue Created" Event aswell as the "Send my eMail event". Can i assign 2 Events?

@Nic: We thought about this but what is not wanted by management that the User gets in touch with the JIRA system, the User should only get the info that Support is aware of his problem and he knows the Key. Then he can call our support.

I'm now trying to get a little bit more detail on listeners... I at the moment only created a dummy Plugin with the Atlassian SDK :). That is my to be honest not very good starting point! My hope was that something like that already exeits...

Nic Brough -Adaptavist-
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.
July 21, 2011

Yes, I thought there might be more detail behind it. The case I outlined needs no code, and hence works well for some of my clients, but I think you need something more clever. Which means a Listener.

0 votes
Nic Brough -Adaptavist-
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.
July 21, 2011

You can do something along these lines.

  1. Change your permission scheme so that it allows "browse" rights to "user custom field"
  2. Change your notification scheme so that "Create" sends mail to "user custom field"

They should get the mail that all the other users get on creation.

For something more flexible, yes, you'll need a listener or post-function (I'd go for listener myself, as I've struggled with post-functions on create-issue sometimes)

0 votes
Jobin Kuruvilla [Adaptavist]
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.
July 21, 2011

You can create a custom issue created event with a new velocity template mapped to it. The new template can have the message as mentioned above.

The new event should be thrown on issue creation by modifying the workflow.

Jobin Kuruvilla [Adaptavist]
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.
July 21, 2011

Check out some notes on customizing mail content as well.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events