Scripted Fields
Use Scripted fields to create custom fields with dynamic content. They let you display information that isn't directly available on a work item by calculating or aggregating data from one or more existing fields. You could use a scripted field to:
- Show a value from a linked instance
- Show a value calculated from the values of other work item fields
- Show a value calculated from the values of fields in other work items
Scripted fields appear on any screens you assign them to.
Available scripted fields
The following scripted fields are available:
- String: Show a text value generated by a script.
- Multi-string: Show multiline text generated by a script.
- Number: Show a number calculated by a script.
- User: Show a single user determined by a script.
- Multi-user: Show multiple users determined by a script.
- Group: Show a single group determined by a script.
- Multi-group: Show multiple groups determined by a script.
- Date and time: Show a date and time calculated by a script.
- Date: Show a date calculated by a script.
For multi user and multi group scripted fields, if any returned account ID or group ID is invalid, the entire field fails to render and an error is shown. The field does not display only the valid users/groups. All returned IDs must be valid.
Output and logging
When you test a script, the output panel shows:
- Anything logged with
console.log(...) - The final value returned by your script with
return
Use console.log(...) for messages, intermediate values, or debugging, and include a return statement for the main result you want to display.
Activity history
Saved scripted fields keep a activity history, so you can review when they were run, and what the output was, making it easier to audit and troubleshoot. Activity history is stored for two weeks before it is refreshed.
Create a scripted field
You can create scripted fields directly in ScriptRunner, or create them in Jira like any other custom field and then configure the script in ScriptRunner. To create a scripted field in ScriptRunner:
Test a scripted field
You can test your scripted fields against test data for work items before using them on real screens. This lets you confirm that your script behaves as expected for a specific work item. Test data is the JSON data that identifies the work item and scripted field context your script runs against. For scripted fields, the JSON data typically includes:
id: the internal ID of the work item your script will run against.context: the numeric ID of the scripted field context in which the script is executing. This lets ScriptRunner resolve context‑specific configuration (for example, different behavior per project or work type).
Test your scripted field as follows:
Edit a scripted field
To edit a scripted field:
Find the custom field ID for a scripted field
The custom field ID is automatically generated when you create a scripted field. To find the custom field ID:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.
- Select Scripted fields.
- Find your scripted field in the list and select Edit.
- The field ID displays as a read-only field on the page.
Enable and disable a scripted field
Disabling a scripted field pauses its script so it no longer calculates a value. The field will appear disabled and empty wherever it is used, but it remains on your screens and contexts, and its configuration is preserved. When you enable the field again, its script runs as normal and the value is recalculated and displayed. This is a safe way to pause a field temporarily without deleting it.
To enable or disable your scripted field:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.
- In ScriptRunner, select Scripted fields.
- Locate the scripted field you want to enable or disable.
- Open the ellipsis (…) menu for that scripted field and select Disable or Enable.
Delete a scripted field
Remove scripted fields you no longer need to keep your list organized and reduce clutter. When you delete a scripted field, it's removed from work items and screens so users can no longer see or use it, but it isn't permanently removed. You can still access it in ScriptRunner (using the Deleted filter) or in the Deleted fields area of the Jira admin settings, and restore it later if needed. The custom field ID is retained and will be the same if you restore the field.
To delete a scripted field:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.
- Select Scripted fields.
- Find the scripted field you want to remove.
- Open the ellipsis (…) menu for that scripted field.
- Select Delete.
- When prompted, confirm that you want to delete the scripted field.
Restore a deleted scripted field
When you restore a scripted field, it becomes active again in Jira and ScriptRunner. Its activity history is available, it's re‑added to all the screens and work items it was associated with before deletion, and it keeps the same custom field ID it had originally.
To restore a deleted scripted field:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.
- Select Scripted fields.
- Use the filter and select Deleted to view deleted scripted fields.
- Find the scripted field you want to restore.
- Open the ellipsis (…) menu for that scripted field.
- Select Restore.