How to Add Score Values to Issue Cards

Sometimes it is valuable to add a score value on the card, which depends on the position of the issue in the matrix.

Example: in a risk matrix the "score" means a "risk level". That level depends on the dimensions "probability" and "consequence".

Step-by-step guide

Use the Jira app Jira Misc Custom Fields that provides a some new calculated custom field types (e.g. "Calculated Text Field" or "Calculated Number Field"). A calculated field containes a formula that returns a value. Use the matrix dimensions to calculate a score value.

Do the following to display a score on an issue card:

  1. In Jira administration:
    1. Install Jira Misc Custom Fields from the Atlassian Marketplace
    2. Create a "Calculated" custom field.
    3. Add a formula to the custom fields description.
  2. In your Matrix configuration, configure the card layout to show your calculated field.

Examples

TypeCustom field typeCode (to be added to custom field description)ExplanationExample Screenshot
Benefit Cost RatioCalculated Text Field
<!-- @@Formula: 
String strCost=issue.get("Cost Range");
String strBenefit=issue.get("Benefit Range");
double dCost=0;
double dBenefit=0;
String strText="unknown";

switch(strCost) 
{
 case "$0 to $100":    dCost = 1; break;    
 case "$100 to $1k":   dCost = 10; break;
 case "$1k to $10k":   dCost = 100; break;
 case "$10k to $100k": dCost = 1000; break;
 case "$100k to $1M":  dCost = 10000; break;
 case "above $1M":     dCost = 100000; break;
 default: intA = 0;
}

switch(strBenefit) 
{
 case "$0 to $100":    dBenefit = 1; break;    
 case "$100 to $1k":   dBenefit = 10; break;
 case "$1k to $10k":   dBenefit = 100; break;
 case "$10k to $100k": dBenefit = 1000; break;
 case "$100k to $1M":  dBenefit = 10000; break;
 case "above $1M":     dBenefit = 100000; break;
 default: intB = 0;
}
 
return "Benefit-Cost-Ratio: " + dCost / dBenefit ;

-->
The code reads out two custom fields (matrix dimensions), defines values for field options and calculates the ratio. The result is given back together with a label.

Risk ScoreCalculated Number Field
<!-- @@Formula: 
String strRP = issue.get("Risk probability");
String strRC = issue.get("Risk consequence");
Integer intRP = 0;
Integer intRC = 0;

switch(strRP) 
{
 case "Almost none":intRP = 1; break;    
 case "Low":        intRP = 2; break;
 case "Medium":     intRP = 3; break;
 case "High":       intRP = 4; break;
 case "Very High":  intRP = 5; break;
 default:           intRP = 0;
}

switch(strRC) 
{
 case "Trivial": intRC = 1; break;    
 case "Low":     intRC = 2; break;
 case "Medium":  intRC = 3; break;
 case "High":    intRC = 4; break; 
 case "Severe":  intRC = 5; break;
 default:        intRC = 0;
}

return intRC *intRP ;
-->
The code reads out two custom fields (matrix dimensions), defines values for field options and calculates the product. This result is given back as a number.