Versions Compared

Key

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

...

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.

message.getHeader(name)

Get value of a message header

Parameters

  • name the name of the header to get

issue

If the email being processed has been associated with is commenting on an existing issue, this contains the issue data. Format 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.

print(str)

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

Parameters

  • str (String) the string to be recorded

RegExp

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

setValue(value)

Sets the value for this Custom Field

...

Code Block
setValue("FieldValue");

...

Using the Issue Context when commenting

When Commenting on issues you are able to use the issue to get values from the issue. for example getting the issue Key, Reporter or any Custom Field. Below are some examples on how to extract specific values.

...

Code Block
issue.fields.reporter.displayName

Example Scripts

Using Regex to extract a specific value from body and set as the field value

...