Issue Context and Default Script Context

Issue Context

A fundamental concept in creating scripts for Jira is the issue context. When a script references custom fields, the issue context can either be implicitly or explicitly defined.

Implicit Context

Whenever a script is run from an automated context such as a workflow or listener, the issue context is provided, as in the example below.

Example Code

string value = #{custom field name};

Setting the Issue Context With the Default Script Context

When running scripts from the SIL Manager, you can use the Default Script Context setting. This allows you to set the context of your script so that it runs exactly as it would in an automated setting. To set the Default Script Context, follow these steps:

  1. Select Run > Default Script Context. The Script context configuration window opens.

  2. Enter the issue key of the issue you want to test.

  3. Select OK.

Note: Leave the Issue Key field empty if you don't want to run the script in an issue context.

Explicit Context

You can create an explicit reference to the issue context by entering key before the custom field.

Example Code

string value = key.#{custom field name};

Additional Help

For support implementing this script, use the bot on this page. 

Filter by label

There are no items with the selected labels at this time.