Versions Compared

Key

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

...

The another ticket with different subject β€œATH201125 –405034 – Visit Early Termination (A)”. It is showing in the auditing page but the subject was never processed & new created was not created , that is what I mentioned instead of creating new ticket , the existing ticket TDAS-55011 was commented. API

Notes

message.getBody()

Get body content of email. Not available for preprocessing task.

message.getSubject()

Gets the Subject content of email.

message.getAllHeaders()

Get all headers of a message.

Code Block
message.getAllHeaders()[headerName]; // Case sensitive

To loop through all headers:

Code Block
let allHeaders = message.getAllHeaders();
for (const header in allHeaders) {
    print(header); //To retrieve header name
    print(allHeaders[header]); //To retrieve header value (Case-sensitive)
}

message.getHeader(name)

Get value of a message header

Parameters

  • name the name of the header to get

issue

If the email being processed is commenting on an existing issue, then this context will contain the field values for the related issue. Allowing for this data to be used within the Script. Format used is as per the Get Issue response from the Jira REST API.

Note: This is only available within the Script Custom Field default and the Script Field Processor.

For more info about using Issue Data see: https://thepluginpeople.atlassian.net/wiki/spaces/JEMHC/pages/3861676043/Manipulate+Issue+data+in+Scripting+features#Showing-the-JSON-object-Values-and-structure

print(str)

Adds output that is recorded during execution and shown in the processing report.

Parameters

  • str (String) the string to be recorded

setOutcome(outcome, reason)

Set the processing outcome of the script

Parameters

  • outcome (String) the outcome type

  • reason (String) the reason for the outcome

Note: outcome must be written in all capitals. Valid outcomes are (IGNORE, FORWARD, DROP)

resultMap

Used to set issue field values. See Map - JavaScript | MDN for usage.

RegExp

Searches within string values for matching content. See RegExp - JavaScript | MDN for usage.

...