The Adaptavist Group LogoDocumentation

Create and Modify Scripted Fields

Note: Change notice: Atlassian's changes to custom field configurations

From January 2026, Atlassian has changed how custom fields are configured in Jira (see this article for details). New custom fields are no longer automatically linked to all field configuration schemes. Instead, you must associate custom fields with a field configuration scheme and add them to the relevant space screens. In addition, Field Configurations and Field Configuration Schemes are merging into a new Field Schemes option.

Impact on Scripted Fields:

When you create a new scripted field that uses custom fields and attempt to add it to a space, it will not appear unless it has first been associated with a field configuration scheme. To associate a scripted field with a space, navigate to Jira Settings > Field Configuration and select the Custom Field (Scripted Field). You can then associate the field with the appropriate field configuration scheme and add the field to the relevant space screen.

Create a Scripted Field

  1. Navigate to ScriptRunner > Scripted Fields.

    Depending on whether or not you have already created scripted fields, you are presented with either a landing screen or a list of the previously created scripted fields.

  2. Click Create Scripted Field from the initial landing screen if none have been previously created.

    If you would prefer to make use of our built-in examples, click Add Examples to add two scripted field examples to your instance.



    OR

    Click Create Scripted Field from the previously created list.

  3. Enter the name of the scripted field in Field Name.
  4. Enter a description for the scripted field that summarises its purpose in the Description field.
    Note: The Identifier field shows the unique identification key for the new scripted field.
  5. Select the scripted field's Field Type from the list provided.

    Ensure you pick the correct field type for the data returned by your script. See Return Types for more information.

  6. Enter a script in the code editor that will run as a Script to execute. This script is triggered when a work item is loaded.
    Tip:View or reuse saved scripts

    Click Load to reuse a previously saved script from Script Manager. Details on how to do this can be found in Reuse scripts in the UI.

    OR

    Alternatively, you can click the Example scripts button to view a list of example scripts related to this feature. So, rather than writing your own script, you can reuse one of the many examples provided, as follows:

    1. Choose an example script from the list provided, and the code automatically appears. You also have the option to search for a particular script.
    2. Click Copy Code and then Close.
    3. Paste the copied code in the code editor.
    CAUTION:

    Scripted fields in Jira Cloud do not dynamically update. The script triggers on work item load, and also when a work item that contains a scripted field is updated. Therefore, changes to the field value are not reflected instantly, and the work item must be reloaded.

  7. Optional: Click Script context to view an information modal highlighting parameters/code variables. For further information on referencing Script Context values, refer to Example Script Variables.
  8. Optional: Select a work item in Test against work item to test the scripted field before saving.
    We recommend carrying out this step.
    CAUTION:

    Any changes to the scripted field's configuration will require a re-test

  9. Click Save.

    Once saved, you will see a new entry in the Custom Field ID column of the scripted fields list that is associated with your newly created scripted field. If you want to modify the custom field, refer to Step 3 below. Scripted fields run when a work item is viewed or updated, so they must be added to the view and edit screens for them to run. To do this:

    1. Open your preferred space from the Jira admin page and click Space Settings.
    2. Navigate to Work Items > Layout, where you will see the default Work Item Layout page.
    3. Drag the newly created scripted field anywhere within the Work Item panel, click Save, and return to Space Settings.

      You can now open any work item and view the scripted field within the layout of that work item.

Edit a Scripted Field

  1. Navigate to ScriptRunner > Scripted Fields.
    A list of all previously created scripted fields is shown.
  2. Optional: Click Delete via the Actions ellipsis for any scripted field you wish to remove.
  3. Optional: Click the relevant entry in the Custom Field ID column if you want to modify the details of any of the custom fields associated with each scripted field.

    You are redirected to the Edit Custom Field Details screen contained within the Work Items section of the Jira admin. After completing the required edits, click Update to confirm your changes, as shown below:

  4. Click Edit on the Actions ellipsis of the scripted field you wish to edit.
    The Edit Scripted Field screen is displayed.
  5. Edit the fields as required.

    Remember, you can choose from our list of example scripts for Scripted Fields.

    Note:Limited edits for Scripted Fields

    There are limits to the changes that can be made here because a custom field has already been created for the scripted field you are editing. If you want to change the Field Name or Description, you need to navigate to the Jira administration section. Also, you must create a new scripted field in ScriptRunner if you want to change the Field Type.

  6. Click Save after all changes are complete.

    You can also click Revert to undo those changes.

Search documentation

Start typing to search the docs.