The use of this routine requires the Power Scripts for Jira add-on be installed and licensed.
Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | attachFileFromEmail(attachmentName, issueKey) | Package | | Alias | | Pkg Usage | | |
Description
Excerpt |
---|
|
Attaches a single file from the incoming email to a specified issue. |
Attaches a single file from the incoming email to a specified issue.
Parameters
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
attachmentName | string | Yes | The name of the attachment from the incoming email. Note that if there are multiple attachments with the same name, this will always attach the first one in the list. | issueKey | string | Yes | The issue to attach the file to. | |
Return Type
Boolean
Returns "true" if file was successfully attached to issue and "false" otherwise.
Example
Code Block |
---|
IncomingEmail email = getIncomingEmail();
string issueKey = matchText(email.subject, "[A-Z][A-Z]+-[0-9]+"); // find an issue key in the subject
if(isNotNull(issueKey)) {
for(string att in email.attachments) {
// only attach PDFs
if(endsWith(att, ".pdf")) {
attachFileFromEmail(att, issueKey);
}
}
} |
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 25 |
---|
showSpace | false |
---|
cql | label = "mail_handler_routine" and space = currentSpace ( ) |
---|
labels | array_routines |
---|
|
We've encountered an issue exporting this macro. Please try exporting this page again later.