Versions Compared

Key

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

Table of Contents

Info
titleRequired apps

Power Actions™ for Jira

Level:  BASIC

Problem

...

Problem

As a project manager or another user with a specific role in the project, you must notify other users by email about new issues or changes in the issue fields

...

. In addition, these emails

...

shouldn’t be sent automatically

...

because not all

...

new issues or changes require an email notification.

...

You can use Power Actions™

...

to create and send emails to all or certain project members

...

.

You can simply let your imagination run free ...

Solution

...

To solve this

...

problem, use a

...

 Power Actions™ custom field that

...

creates an email

...

based on a template, and sends it to

...

selected recipients.

Step 1: Create a new Power Actions™ Custom Field

The first step consists in creating a new Power Actions™ custom filed, as follows:

  1. Go to the Administration page.

  2. In

...

  1. the Issue section

...

  1. , click Custom Fields.

  2. Click the Add Custom Field button in the upper-right corner to add a new custom field.

  3. Select the Power Actions™ Custom Field option

...

  1. . Click Next.

...

  1. Rename the new custom field

...

  1. to Email Issue

...

  1. .

...

  1. Selectyourapplicable issue types and

...

  1. context

...

  1. to view the new

...

  1. custom field only on certain issues and projects

...

  1. . By default, the custom field is visible in global context.

  2. Click Finish.

Step 2: Configure your Power Actions™ Custom Field

...

  1. To configure the Email Issue custom field

...

  1. , select the cog icon on the right.

  2. Go to the Custom Fields page to find your Email Issue custom field.

  3. Click Configure.

  4. To create a button that triggers the email sending action, go to the Buttonssection at the bottom of the page

...

  1. . Click the

...

  1. Edit Buttons link.

  2. Click Add New Power Actions™

...

  1. and enter Send Email

...

  1. as the button name. Click Add.

  2. Five links for this button

...

  1. are now displayed on the right of the

...

  1. page.

...

  1. The first three

...

  1. are the

...

  1. SIL™ scripts that

...

  1. control it. They are:

    • The

...

    • Condition Script

...

    • . It contains the condition for the button visibility. The default value is visible

...

    • (the user

...

    • can see and

...

    • click this button

...

    • ).

    • The

...

    • Screen Script

...

    • . It allows you to determine if the

...

    • email sending action requires additional data.

    • The

...

    • Action Script

...

    • . It sends the email you

...

    • want to the specified email addresses.

Step 3: Configure the Power Actions™ Screen Script

...

To send the email

...

, configure the Power Actions™ Scripts.

...

Info

The Condition Script can be

...

configured to prevent certain users to send the emails. For more information

...

, go to the Condition Script page.
The Screen Script is used to

...

display a message

...

to confirm the email sending action. This is a security measure to prevent an accidental click

...

of this button.

To edit

...

the script, click

...

Screen Script

...

on the Configure Email Issue page.

...

Then enter the following code:

Code Block

...

string[] ret;
ret = BA_createInput("Message", "You are about to send a email message to all members of this project.", true);
return ret;

This code

...

displays a read-only message

...

.

Step 4: Configure the Power Actions™ Script

The Action Script

...

sends the email to

...

selected users.

To edit the Action Script, click

...

Script

...

on the Configure Email Issue page

...

. Then enter the following code:

Code Block

...

titleAction Script
string[] to = projectMembers(project);
string[] cc;
string subject = "JIRA Email Issue: " + summary;
string template = "template.tpl";
string language = "en_US";
print(attachments);
if (sendEmail(userEmailAddress(currentUser()), to, cc, subject, template, language, attachments))
{
 return "The email has been sent succesfuly";
}
else
{
 return "An error occured when sending the email.";
} 

This code sends a template email to all the project members including the current user. For more information

...

on sending an email using SIL™

...

, go to the sendEmail

...

page.

...

Tip

Create and rename to template.tpl the email template from the previous code

...

to

...

use it again in the following steps.

Step 5: Build the email template

After the plugin installation

...

,

...

a new

...

Kepler General Parameters

...

option is displayed.

Go

...

to the option and select

...

the katl-commons

...

plugin from the Select plugin list.

A configuration

...

Email Template Directory

...

indicates the folder where the templates are

...

stored. The directory path is relative to

...

...

remaining part of the email configuration is extracted from the standard

...

Jira configuration. You can find this on Administration > Mail Servers > SMTP Mail Server.

You can create a new template in this folder using your

...

preferred text editor.

...

To add certain issue field values

...

to the template

...

, use the $field$ notation, where field is the field name

...

you want to

...

enter into the text. Here is an example:

...

Email Template
Code Block
Hello $recipient$,
 
This is a test template sent from $assignee$'s issue $key$. The summary for this issue is: $summary$.
This issue has the following fields:

 Type : $type$
 Priority : $priority$
 Labels : $labels$
 Status : $status$
 Resolution : $resolution$

 $key$ is described as follows: 
 $description$
 
This issue was created on $created$ and updated on $updated$. It's due date is: $dueDate$. The assignee is $assignee$ and the reporter is: $reporter$.

Best regards,
$reporter$

This email was automaticaly generated by the JIRA Blitz-Action plugin:
https://marketplace.atlassian.com/plugins/com.keplerrominfo.jira.plugins.blitz-actions
or
http://jira-plugins.kepler-rominfo.com. 
Please do not reply.
Info

...

titleEmail Templates

...

For more information, go to Email Templates and Mail Configuration.

Test

You can now test

...

your custom field

...

.

Go to the issues you

...

selected in the first step of this recipe.

...

Theissue view now displays the Send Email button

...

.

Image Modified

...

Click the

...

Send Email button and confirm your email

...

.

Image Modified

Click

...

Execute

...

to send the email

...

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

...

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:

...

-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

...

.

Table of Contents

Table of Contents