Versions Compared

Key

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

...

Info
titleRequired apps

Power Actions™ for Jira

Level:  BASIC

Problem

In certain situations some users needs to be informed about new issues or changes in the issue fields by the project manager or other users with specific roles in the project. Also, these emails are not to be automatically sent because not all the changes or issues need an email notification.

...

You can simply let your imagination run free ...

Solution

In order to solve this issue you will have to use a Power Actions™ custom field that builds an email via a template and sends it to its recipients.

Step 1: Create a new Power

...

Actions™ Custom Field

The first step consists in creating a new Power Actions™ 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 on it.
  • Add a new custom field from the button in the right top of the screen ("Add Custom Field").
  • Choose the Power Actions™ Custom Field option and press Next.
  • Name this newly created custom field: "Email Issue".
  • Choose your applicable issue types and applicable context in order to view the new created custom field only on certain issues and projects - as you desire. By default the custom field is visible in global context.
  • Click Finish.

Step 2: Configure your Power Actions™ 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 can be done by going to the Custom Fields page.
  • Click the Configure link.
  • Now we'll need to create a button that will trigger the email sending action.
  • Click on the Edit Buttons link. You will find it on the bottom of the page in the section named Buttons.
  • Add New Power Actions™ by creating a Button Text called: "Send Email". Press the Add button.
  • At the end of this operation 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.
  • The third Script , named Action Script, sends the email you'll want to the specified email addresses.

Step 3: Configure the Power Actions™ Screen Script

In order to send the email you will need to configure the Power Actions™ Scripts.

...

This code will show a read only message in the screen.

Step 4: Configure the Power Actions™ Script

The Action Script is the one that sends the email to the desired users. To edit the Action Script click the Script link from the Configure Email Issue page and  add the following code:

...

Because we used in the previous code a email template we'll need to create and use this template named: template.tpl.

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 there and select "katl-commons" plugin 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.

...

Info
titleWorking solution

In order to use this recipe with SIL Engine™ version 2.5.0, 2.5.1, 2.0.10 you will need to make the following settings:

  • Download the mail.jar and theactivation.jar archives from the maven repository (or any other).
  • Create a folder on your system named endorsed and put those two archives in the folder.
  • If you are using Windows create a new environment variable named "JAVA_ENDORSED_DIRS" with the value "path_to_endorsed_folder". (Example: set JAVA_ENDORSED_DIRS="D:\JiraInstall\endorsed").
  • Or you can specify your endorsed folder as a java system property like so:
    -Djava.endorsed.dirs="D:\JiraInstall\endorsed" with your endorsed directory path.

SIL Engine version 2.5.2 and higher does not need this configuration.

See also

Email from Power Actions™ for Jira

...