Scripted Fields
A scripted field is a Jira custom field whose value a backend script computes when the work item is shown.
Set one up
-
In Scripts, create a script of kind Custom field and save it.
-
In Jira settings → Work items → Fields, create a field of one of these types:
Field type Return Scripted Text A string Scripted Number A number Scripted User An account id ( '5b10a…') or{ accountId }Scripted Date An ISO date ( '2026-10-31')Scripted Date time An ISO date time, or a Date -
Open the field's context and choose your script in its Script Toolkit configuration.
-
Add the field to the screens where it should appear.
What the script receives
| Field | Value |
|---|---|
input.payload.issue.id |
The work item whose field is being shown |
input.payload.currentValue |
The field's stored value, if any |
const res = await requestJira(`/rest/api/3/issue/${input.payload.issue.id}?fields=subtasks`)
const { subtasks } = (await res.json()).fields
return subtasks.filter((task) => task.fields.status.statusCategory.key === 'done').length
Good to know
- Values are computed when the work item is viewed. Jira asks for them as it renders the field; they don't recalculate when the work item changes through the REST API or automation.
- A field's script has 5 seconds. A script that fails or runs out of time leaves the field empty; the work item still opens normally, and the error is in Logs.
- Field runs have their own daily limit, separate from other scripts, so heavy browsing can't use up the budget that jobs and triggers need.
- Test a field script from the editor's Test tab with a work item key.