Versions Compared

Key

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

Incoming emails can be efficiently processed using SIL scripting, providing an unparalleled level of flexibility. Review the following video for an overview of this feature.

...

To set up an incoming mail configuration, navigate to the Integrations → Incoming Mail page in the Power Apps Config page.

...

Code Block
IncomingEmail mail = getIncomingEmail();

string issueKey = mail.subject;
if(issueExists(issueKey)) {
    // add comment

    string commentText = mail.body;
    string projectKeyuserCommenting = getProjectKeyByName(getUserByEmail(mail.from).key;
    
    addComment(issueKey, userCommenting, commentText);
    attachAllFilesFromEmail(issueKey);
    
} else {
    // create issue
    
    string summary = mail.subject);
    string description = mail.body;
    
    string [] fields = {};
    fields += {"reporter", getUserByEmail(mail.from).key};
fields += {"watchers", getUserKeysFromEmails(mail.cc)};
createIssue(projectKey    
    createIssue("PROJECT NAME", "", "Task", "Created via Incoming mail script"summary , "Minor", mail.bodydescription, {}, "", "", fields);
}

For more information regarding the IncomingEmail SIL structure and other useful email functions, visit this page: https://appfire.atlassian.net/wiki/spaces/PSJC/pages/999162356/Incoming+Mail+Processing+Functions#IncomingMail

...