Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleRequired Plugins

You will need the following JIRA pluginsJira apps:

  1. Power Actions for JIRA(former Blitz-Actions)Jira

Level:  BASIC

Problem

Some times the project manager or any other JIRA user Jira user that can view issue, wants to send a personalized e-mail to some email address. This message is not to be sent automatically, but only if the user explicitly wants to do it and to whoever he wants.

This example shows you how to do that by using Power Actions for JIRAJira and the SIL.

Solution

To resolve this problem you will have to use a Blitz Action custom field that creates an email and sends it to its recipients.

Step 1: create a new Blitz Action Custom Field

First of all you'll need to create a new Blitz Action custom filed, as follows:

  • Go to Administration page.
  • In this page go to the Issue section.
  • Here you will find a link named Custom Fields, you should click it.
  • Add a new custom field from the button in the right top named: "Add Custom Field".
  • Choose Blitz Actions Custom Field and press next.
  • Name this newly created custom field: "Email Issue".
  • Choose applicable issue types and applicable context in order to view the new created custom field only on certain issues and projects.
  • Click Finish.

Step 2: Configure your custom field

Configure Email Issue custom field by doing the following:

  • Choose the cog icon at right of the screen for your Email Issue custom field. This is done by going to the Custom Fields page.
  • Choose the Configure link.
  • Now we'll need to create a button that will trigger the dialog for the email details.Click on the Edit Buttons link. You will find it on the bottom of the page in the section named Buttons.
  • Add New Blitz Action by creating a Button Text called: "Send Email". Press the Add button.
  • After you created this button you'll see 5 links for this button in the right of the screen.
  • The first three of them are the SIL scripts that controls it. The first script, named Condition Script, contains the condition for the button visibility. The default value is visible, so if you want all the user to see and action this button you can let the default script.
  • The second Script, named Screen Script, allows you to determine if the send email action requires additional data and builds a form that the user can fill in.
  • The third Script , named Action Script, sends the email you'll want to the specified email addresses.

Step 3: Configure the Screen Script

Click on the Edit Screen Script link. A panel will appear in which you will write the following SIL script code:

...

Save the code and go back to the Configuration page for the

Step 4: Configure the Action Script

Click on the Edit Script link. A new page will appear in which you can write this SIL code:

...

As we previously said we can use a template for the email which means that we have to create a template file that contains all the relevant fields of the issue. Also, for more information about sending an email using SIL consult the sendEmail routine page.

Step 5: Build the email template

After the installation of the plugin, in the "Administration" menu, a new option will appear named "Kepler General Parameters". Go to it and select "katl-commons" plugin app from the Select plugin list. A configuration option named "Email Template Directory" depicts the directory where  the templates are kept. The directory path is relative to the jira.home.dir/kepler. The rest of the email configuration is extracted from the standard JIRA configuration (Administration->Mail Servers->SMTP Mail Server).

...

Info
titleEmail Templates

You can consult the Email Templates page for further information. Also consult the Mail Configuration page.


Test

You can now test this custom field by going to the issues you have selected in the first step of this recipe.

The Issue screen will have the Send Email button, like this:

Image RemovedImage Added

The Screen of the Button will appear like this:

Image RemovedImage Added

An example of a filled in form:

Image RemovedImage Added

Press Click Execute and that's all.


You just saved 100 US dollars, so for sure you can eat at least a chocolate bar.

...