Parent last updated field
This Scripted DateTime Field shows when the work item's parent last changed. It's empty when the work item has no parent.
Applies to: Script Master for Jira Β· Cloud
Jira returns the updated field as an ISO 8601 date and time, which is what a DateTime field needs.
const itemResponse = await api.asApp().requestJira(route`/rest/api/3/issue/${payload.issue.id}?fields=parent`);
const item = await itemResponse.json();
const parentId = item.fields?.parent?.id;
if (!parentId) return undefined;
const parentResponse = await api.asApp().requestJira(route`/rest/api/3/issue/${parentId}?fields=updated`);
const parent = await parentResponse.json();
return parent.fields?.updated;
The DateTime: Last update of the parent work item snippet in the app does the same.
Relatedβ
- Write the field script: where to paste this script.
- Parent assignee field: another value read from the parent.
- Scripted custom fields: what each field type must return.