Skip to main content

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;