Email from Blitz Actions
Table of Contents |
---|
Info | ||
---|---|---|
| ||
You will need the following JIRA plugins: Level: BASIC |
...
Click on the Edit Script link. A new page will appear in which you can write this SIL code:
Code Block | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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:
Katl-commons version 2.5.2 and higher does not need this configuration. |