ScriptRunner SRXEnv environment variable - HeikoBrenn/ScriptRunner GitHub Wiki

When using ScriptRunner you can work with ScriptRunner environment variables ($SRXEnv).

Available keys

[string]ReportEmail:

If you have an SMTP server available, the ScriptRunner service can send you email notifications containing execution reports, on error or on success. Recipient email address (comma separated list). The full action report will be sent to this address.

[string]ResultEmail:

Recipient email addresses (comma separated list). Only the ResultMessage will be sent to this address.

[ArrayList]ResultList:

A scripted query must specify this list of string values. The list is associated with the corresponding action parameter.

[ArrayList]ResultList2:

A scripted query can specify this optional list of display names. The list appears as drop-down list for the associated action parameter.

[string]ResultMessage:

This message will show in the reports, and in the immediate result window of the Delegate and Self-Service App.

[string]ResultObjectJSON:

The script can now provide (simple) structured result data by writing a (small) JSON string to $SRXEnv.ResultObjectJSON. ScriptRunner will provide this JSON string in the OutSerializedPSObjects report field, for post-processing by the caller of the Web Service Connector.

[DateTime]SRXStarted:

The timestamp of the start of the script execution. (readonly)

[string]SRXStartedBy:

The user account that requested the execution of the script. (readonly)

[string]SRXStartedIP:

IP address of the client that sent the request to perform the script execution. (readonly)

[string]SRXStartedVia:

Name of the application that started the execution of the script. (readonly)

[string]SRXDisplayName:

Name of the ScriptRunner Actions that started the script. (readonly)

Example

Example 1