Versions Compared

Key

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

The use of this routine requires the Power Scripts for Jira add-on be installed and licensed.

Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

attachFileFromEmail(attachmentName, issueKey)

Package

Alias

Pkg Usage

...

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);
        }
    }
}

...