Versions Compared

Key

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

Email from Blitz Actions

Table of Contents

Info
titleRequired Plugins

You will need the following JIRA plugins:

  1. Blitz-Actions

Level:  BASIC

...

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


Code Block
titleAction Script
string[] to = replace(BA_getSingleValue(argv, "Send to"), ",", "|");
string[] cc = replace(BA_getSingleValue(argv, "CC"), ",", "|");
string subject = BA_getSingleValue(argv, "Subject");
string body = BA_getSingleValue(argv, "Email body");
string[] attachments = BA_getMultiValues(argv, "Attachments");
return sendEmail(userEmailAddress(currentUser()), to, cc, subject, body,"en_US", attachments);

This code makes the following operations:

 


  • Takes the email addresses that the user filled in and if there are more than one email creates a list with all of them.
  • Gets the subject of the email.
  • Builds the body of the message by using a template or by creating the email body from the text that the user filled in.
  • Gets the paths from the attachments from the "Attachments" field of the Email Issue custom field.
  • Sends the email with all the details filled by the user that send the email.

...

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.

...

Press Execute and that's all.

 


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


Info
titleWorking solution

In order to use this recipe with katl-commons version 2.5.0, 2.5.1, 2.0.10 due to some problems you will need to make the following settings:

  • Download the mail.jar and the activation.jar archives from the maven repository.
  • 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.

Katl-commons version 2.5.2 and higher does not need this configuration.