Skip to end of banner
Go to start of banner

attachAllFilesFromEmail

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Current »

Availability

This routine is available starting with Power Scripts 4.0.0 (server).

Syntax

attachAllFilesFromEmail(issueKey)

Description

Attaches all attachments from the incoming email to a specific issue.

Parameters

ParameterTypeRequiredDescription
issueKey

string

YesThe issue to attach the file to.


Return type

number

Returns the number of files successfully attached to the issue.

Example

IncomingEmail email = getIncomingEmail();

string issueKey = matchText(email.subject, "[A-Z][A-Z]+-[0-9]+"); // find an issue key in the subject
if(isNotNull(issueKey)) {
    attachAllFilesFromEmail(issueKey);
}

See the Predefined Structures page for more information about the JEmailAttachment structure used in this example.

See also

  • No labels