The Adaptavist Group LogoDocumentation

Scripted Field Examples (In-app)

Browse in-app scripted field examples that show transition dates, parent hierarchy, days in status, last comments, and rolled-up story points.

The following examples are available in-app via the Example scripts modal when you're creating scripted fields. You can copy these scripts, adapt the logic to your own fields and workflows, and then add the scripted fields to the relevant screens (see Atlassian's documentation for more information).

Get first transition date

Return the date and time of the first status transition for a work item by scanning its changelog. Use this script with the Date & time field type.

Why it's useful: Helps you understand when work first began moving through the workflow, which is useful for lead-time analysis, SLA checks, and historical reporting.

Get most recent transition date

Return the date and time of the most recent status transition for a work item by scanning its changelog. Use this script with the Date & time field type.

Why it's useful: Lets you see at a glance when something last changed status, making it easier to spot stale or stuck work and to build dashboards based on recent activity.

Show parent hierarchy path

Return a string showing the hierarchy of parent work items (for example, PROJ-1 - Parent summary > PROJ-2 - Grandparent summary). Use this script with the String field type.

Why it's useful: Provides immediate context for where a work item sits in the hierarchy, particularly helpful in large initiatives, portfolio reporting, and dependency tracking.

Calculate critical points

Calculate a numeric critical points value for a work item by combining its priority, impact level, and customer tier into a single weighted value. Use this script with the Number field type.

Why it's useful: Provides a single sortable metric to rank work by business importance, making backlog prioritization, triage, and capacity planning more data‑driven.

Calculate duration between start and due dates

Calculate the number of days between a work item's start date and due date, returning the duration as a numeric value. Use this script with the Number field type.

Why it's useful: Helps estimate and compare the planned duration of work, enabling better scheduling, forecasting, and identification of items with unusually long timeframes.

Show last comment

Return a plain-text summary of the most recent comment on a work item, including the author and truncated body. Use this script with the String field type.

Why it's useful: Surfaces the latest discussion directly in lists and reports, so teams can quickly see the most recent update without opening the work item's full comment history.

Show days in current status

Return a text summary of how many days a work item has been in its current status (for example, 5 day(s) in "In Progress"). Use this script with the String field type.

Why it's useful: Makes it easy to spot items that have lingered too long in one status, supporting SLA monitoring, bottleneck detection, and workflow health checks.

Reverse the summary text

Return the work item's summary text reversed, for use in a String type scripted field.

Why it's useful: Primarily useful as a learning or debugging example; it demonstrates how to read, manipulate, and return text values in a scripted field without affecting real data.

Roll up story points from child work items

Sum the story points from child work items (and the current work item) and return the total for use in a Number type scripted field.

Why it's useful: Provides an automatic roll‑up of effort from lower‑level items to their parent, which is essential for planning and tracking progress on epics, features, or higher‑level initiatives.

Search documentation

Start typing to search the docs.