Sample Formulas
Items and Properties
Access an item property
Use the following format: item.property
The following returns the release date for each fix version:
fixVersions.releaseDate
Note: if the fix version field contained multiple values, multiple dates will be returned.
For a list of accessible item types and their properties, see Item Property Reference.
See how many sprints an issue has been added to
sprint.size()
Analytics
Calculate time needed to burn down the backlog
Assuming your team can accomplish 10 story points a week, this will tell us how long (in weeks) it will take to burn down work and get to certain items further down the backlog. To adjust how many story points the team can work in a week, simply change the "velocity" value.
WITH velocity = 10:
CONCAT(SUM#preceding{story_points} / velocity, "w")
For this example to work most effectively, the structure should be sorted based on how you choose which work to complete first. See Sort Generators for more information.
Calculate days past due
This example checks for items that are overdue and returns the number of days the item is overdue.
IF dueDate < NOW():
DAYS_BETWEEN(dueDate, NOW()) CONCAT " days late"
Compare the original estimate to work logged and the remaining estimate
IF originalEstimate:
(timeSpent + remainingEstimate) / originalEstimate
ELSE:
"not estimated"
Calculate the interquartile range of story point estimates
WITH points = ARRAY { storyPoints } : // Holds all the story points of the children.
QUARTILE(points, 3) - QUARTILE(points, 1)
JQL
Identify recently created issues
This example identifies issues created within the past 4 weeks.
IF JQL{created > "-4w"}:
"scope creep"
To look at issues made more or less recently, update the "4w"; to display a different notification, change the "scope creep" text.
Versions
Check for a specific fix version
fixVersions.CONTAINS("v1")
If the issue contains that fixVersion, returns 1 (true). Otherwise, returns 0 (false).
Get the latest/earliest fix version
fixVersions.UMAX_BY($.releaseDate) // latest
fixVersions.UMIN_BY($.releaseDate) // earliest
Find the largest time span of an affected version
affectedVersions.MAP(IF $.releaseDate AND $.startDate: $.releaseDate - $.startDate).MAX()
For each Affected Version, subtracts the Start Date from the Release Date, and returns the Affected Version with the largest result.
Want the shortest result? Change MAX to MIN.
Learn more: MAP function
Show all versions referenced in the subtree
VALUES { ARRAY(fixVersions, affectedVersions).FLATTEN().UNIQUE() }
Get all fix versions with future release dates
fixVersions.FILTER($.releaseDate AND $.releaseDate > NOW())
Show all released affected versions
affectedVersions.FILTER($.isreleased)
Show all issues released during a set period of time
DATE(“0/Jan/2021”) < fixVersion.releaseDate
AND fixVersion.releaseDate < DATE (“31/Mar/2021”)
Check that child issues and paret issues have the same Fixversion
with parentVersion = PARENT{FixVersion}:
if(parentVersion and !parentVersion.contains(fixVersion); "version mismatch")
Users
Show everyone who worked on the task
ARRAY(reporter, assignee, developer, tester)
Note: developer and tester are custom fields - they will be automatically mapped only if those custom fields exist in your Jira instance.
Show everyone who worked on any task in the subtree
VALUES { ARRAY(reporter, assignee, developer, tester) }
Note: developer and tester are custom fields - they will be automatically mapped only if those custom fields exist in your Jira instance.
Markdown
Change Text Color
This example uses color-coded text to let users know when issue due dates are approaching (or overdue).
IF dueDate < today():
":panel[OVERDUE]{color=red}"
ELSE IF DAYS_BETWEEN(today(), dueDate) <= 7:
":panel[Due Soon]{color=green}"
ELSE IF DAYS_BETWEEN(today(), dueDate) > 7:
":smile:"
ELSE:
":panel[Needs Due Date]{color=blue}"
Change Background Color
This example changes the background color of the cell, according to the status category, and returns the summary text for each issue.
WITH format(text, color) = """:panel[${text}]{backgroundColor=${color}}""" :
CASE(status.category,
"To Do", format(summary, "gray"),
"In Progress", format(summary, "blue"),
"Done", format(summary, "green")
)
You can easily customize this by changing the return value, altering the colors, or combining this effect with a larger formula.
Try experimenting with text and background color combinations - this can be a great way to draw attention to key data points.