Subtasks count field
This Scripted Number Field shows how many subtasks a work item has.
Applies to: Script Master for Jira Β· Cloud
The script reads only the subtasks field of the work item and counts its entries.
const response = await api.asApp().requestJira(route`/rest/api/3/issue/${payload.issue.id}?fields=subtasks`, {
headers: { 'Accept': 'application/json' }
});
const data = await response.json();
return data.fields?.subtasks?.length ?? 0;
Relatedβ
- Write the field script: where to paste this script.
- Attachments count field: count the files on a work item.
- Parent status field: show a value from the parent instead.