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