jira smart values math expressions examples

Jira Smart Values: Math Expressions Examples

By Robert Robinson
AD

JIRA, an essential project management tool for agile teams, offers a powerful feature known as "smart values." These smart values allow users to encapsulate complex data and enable dynamic calculations using math expressions. Let's explore how to leverage math expressions in JIRA smart values to increase efficiency and automation in your workflows.

Smart values in JIRA enable you to calculate fields based on other fields. For instance, you can calculate the remaining work effort as the sum of remaining time estimates for all linked issues. Before we dive into examples, let's understand the basic syntax of math expressions used in JIRA smart values.

Basic Syntax of Math Expressions

Math expressions in JIRA smart values use Java's expression language. Here's a quick overview:

AD
Expressions in Math - Definition, Types, Examples | What is Expression in Math?
Expressions in Math - Definition, Types, Examples | What is Expression in Math?
Absolute Value Worksheets
Absolute Value Worksheets
8 Math Expressions Names and Examples - Lessons For English
8 Math Expressions Names and Examples - Lessons For English
  • Operators: +, -, *, /, %, ^ (exponent), Link children, Link parents
  • Operands: Numeric values, Issue fields, Variables
  • Functions:atem() - at:this() - at:parent() - at:child() - sum() - min() - max() - avg() - total()

Once you're familiar with the syntax, let's dive into real-world use cases.

Example 1: Calculating Remaining Work

Let's say you want to calculate the remaining work effort for a task. You have two custom fields: 'original time' (in hours) and 'time spent' (in hours). The remaining work can be calculated as:

the poster shows different types of expressions for students to use in their writing and math skills
the poster shows different types of expressions for students to use in their writing and math skills
Simplifying expressions | K5 Learning
Simplifying expressions | K5 Learning
Absolute Value Function Explained | Easy Algebra & V-Shaped Graph Guide
Absolute Value Function Explained | Easy Algebra & V-Shaped Graph Guide

"original time" - "time spent"

To set this up as a smart value:

AD
  1. Go to Project settings > Fields > Custom fields.
  2. Edit the target field (e.g., 'remaining work').
  3. In the 'Calculation formula' section, enter the expression above.
  4. Click Update.

Example 2: Calculating Total Work for a Multi-Level Sub-task Hierarchy

Now, let's calculate the total original work for a multi-level sub-task hierarchy. Assuming you have a custom field 'original time' at each level, you can use the sum() function like this:

a sign that says mental math m?
a sign that says mental math m?
an image of different symbols and their meanings
an image of different symbols and their meanings
What Is an Algebraic Expression? | Definition, Parts, Examples & Expression vs Equation
What Is an Algebraic Expression? | Definition, Parts, Examples & Expression vs Equation
a poster with different types of math notes
a poster with different types of math notes
an image of a sign with the numbers and symbols for different types of expressions on it
an image of a sign with the numbers and symbols for different types of expressions on it
absolute values
absolute values

sum("original time", at:child())

This will sum up the 'original time' of all child issues and descendants, giving you the total original work for the entire hierarchy.

AD

Calculating with Issue Links

JIRA smart values also allow you to perform calculations using issue links. Let's explore how to calculate the total remaining time for all linked issues.

two numbers and three times on a piece of paper with the same number in it
two numbers and three times on a piece of paper with the same number in it
Variables Expressions Infographic
Variables Expressions Infographic
Simplifying Algebraic Expressions ✨ | Step-by-Step Maths Guide
Simplifying Algebraic Expressions ✨ | Step-by-Step Maths Guide
an image of the math formulas for students to use in their classroom or home
an image of the math formulas for students to use in their classroom or home
Expressions Cheat Sheet
Expressions Cheat Sheet
Math For Dummies, Pure Mathematics, Math Formula Sheet, Ged Math, Aptitude And Reasoning, Math Competition, Act Math, Chemistry Basics, Mathematics Worksheets
Math For Dummies, Pure Mathematics, Math Formula Sheet, Ged Math, Aptitude And Reasoning, Math Competition, Act Math, Chemistry Basics, Mathematics Worksheets
an image of different symbols and their meanings
an image of different symbols and their meanings
Difference of Squares Formula Explained | Easy Algebra Factoring Guide
Difference of Squares Formula Explained | Easy Algebra Factoring Guide
a sign that says expression simplily and correct answer, with the same numbers
a sign that says expression simplily and correct answer, with the same numbers
an image of the book's cover showing two different types of math
an image of the book's cover showing two different types of math
the mental math shortcut table
the mental math shortcut table
Simplifying Rational Expressions
Simplifying Rational Expressions
Expand the brackets and simplify expressions worksheet
Expand the brackets and simplify expressions worksheet
Simplifying Radical Expressions Anchor Chart | Algebra Square Roots Poster
Simplifying Radical Expressions Anchor Chart | Algebra Square Roots Poster

Example 3: Calculating Total Remaining Time for Linked Issues

Let's assume you have a custom field 'remaining time' for each linked issue. You can use the Link children operator and the sum function to calculate the total remaining time:

sum("remaining time", Link children)

AD

This expression will sum up the 'remaining time' of all issues linked to the current issue.

Example 4: Calculating Average Time Spent for Linked Issues

Now, let's calculate the average time spent on all linked issues. Assuming you have a custom field 'time spent' for each linked issue, use the avg() function like this:

avg("time spent", at:parent())

This expression will calculate the average 'time spent' of all issues linked to the parent issue.

Embracing smart values and math expressions in JIRA allows you to automate calculations, enabling you to focus on making data-driven decisions rather than performing repetitive tasks. As your team's needs evolve, experiment with different expressions to unlock new levels of efficiency and automation in your workflows.

AD