Structure (DC)
Breadcrumbs

Creating a Formula

Follow these steps when you need to create a new formula. You can also follow these steps with Automation, including Effectors.

Functions use the Expr Language, which supports variables and arithmetic operations.

If you’re not sure what formula to use, or want examples of formulas before writing your own, you can use bundled formulas.

Select Load Formula... to see the list of formulas you can use.

To create a formula:

  1. Name your formula and then enter the formula in the text field.

    Entering a formula
  2. Select Save.

Testing formulas

When you save your formula, Structure will review it and then attempt to link your variables to issue fields or other attributes. Errors are displayed below your formula, highlighted in red. If the review returns no errors, and each item has a green check mark, your formula is ready to use.

Formula with Variables Matched to Jira Fields

Example formula

The following example is a formula that tracks if your project is on track to complete each epic in time:

IF type = "epic" :
    originalEstimate - SUM#children { timeSpent + remainingEstimate }

This formula tells Structure to:

  1. Check if the issue is an Epic: IF type = "epic" :

  2. If so, pull the Time Spent and Remaining Estimate for each child issue: { timeSpent + remainingEstimate }

  3. Add those values together: SUM#children

  4. Subtract the total from all child issues from the epic's Original Estimate: originalEstimate -

Handling formula errors

Formula errors may occur because of:

  • Unmapped Variables: Structure will attempt to map your variables to known attributes. If you receive this error, you may need to map your variables manually.

  • Syntax Errors: Occurs when the Expr syntax of your formula is incorrect. The part of the formula that failed to parse has a red highlight. Often this is a simple error like missing a closing parenthesis. 
    Review your formula and go to the Expr Language guide for possible solutions.

  • Function Resolution Errors: Occurs when the formula contains an unknown function. The unknown functions will have a red highlight.
    Check these function for potential spelling issues. If that doesn’t fix the error, Go to the Expr Function Reference and Aggregate Function Reference to make sure the function is supported.

  • Expr Validation Errors: Occurs if there is a construct that is not allowed in a formula. Hover over the formula’s red highlight to see the error message. If multiple areas are highlighted, there are multiple errors to fix. Go to the list of possible validation errors to learn more.

Handling unexpected results

Your formula may not work as expected, even if it passes the automatic review. If this happens, you may need to edit your variables, options, or format; or you may need to revise the full formula.

Additional Resources