Search

Categories
 BigPicture

About BigPicture

BigPicture installation and updates

Quick start with BigPicture

BigPicture Sizing Guide

Cloud vs. Server - Key Differences in BigPicture on These Platforms

BigPicture Export

Progress Tracking

Tutorials and tips

Integrations

 BigPicture 7.10 and earlier

Concept of a Program

Setting up BigGantt and BigPicture to support next-gen projects


 BigPicture release notes

BigPicture Cloud Backlog

 BigGantt

About BigGantt

BigGantt installation and updates

Cloud vs. Server - Key Differences in BigPicture on These Platforms

 BigGantt release notes

Shortcuts
 Release notes
 BigPicture
 Jira Cloud

 Jira Server

 Trello

 BigPicture Enterprise
 Jira Cloud

 Jira Server

 BigGantt
 Jira Cloud

 Jira Server

 BigTemplate
 Jira Cloud

 Jira Server

Knowledge Base

Tutorials and tips

Trust Center

BigPicture 8 is here!

Discover the landmark edition of the Atlassian Marketplace top-selling app! The new version is available to all Cloud, Server and Data Center users. Visit BigPicture 8 Documentation to learn more about it.

Keep in mind, this setup is dependant on implementation of a third party solution - as such, it is not supported by SoftwarePlant.
This page serves to advise you on availability of such option.

User story

As a Risk manager, I would like to order risks visualised by BigPicture. I need a list which has the most dangerous risks at the top and the least significant at the bottom.

Custom solution

Assuming that

 - the Jira instance has ScriptRunner installed (link to marketplace add-on)

 - there are two custom fields, created automatically by BigPicture called Risk probability and Risk consequence

Configuration needed

If the above is satisfied, then go through the steps of creating a ScriptRunner Scripted field which requires a Jira Admin access. Screenshot bellow marks the key steps to reach this configuration:

In the next step paste the code below into the text area marked on the screenshot:

 

Code with custom logic calculating the numerical Risk ranking 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.fields.CustomField
import org.apache.log4j.Logger

/**
 * Script which reads text value from two custom fields and converts then to a numeric value.
 * By default, two custom fields which are taken into consideration:
 *  - 'Risk probability'
 *  - 'Risk consequence'
 *
 * For each field a set of possible values is defined in this script.
 * Each value is assigned a numerical value which is later used for multiplication.
 * Assignment of text to a number is done in 'switch' blocks.
 * To map a new text value to a number, insert 3 lines:
 *  case "Input the text value to map":
 *      consequenceNumberValue = "Input the number to be mapped as a n integer e.g. 5";
 *      break;
 * Example of such new mapping for Risk consequence:
 *  case "Critical":
 *      consequenceNumberValue = 9;
 *      break;
 * Example for new Risk probability mapping:
 *  case "Very low":
 *      probabilityNumberValue = 1;
 *      break;
 *
 * Script can be extended to calculate the Ranking with different formula and using different amount of data.
 * */

def log = Logger.getLogger("scripts.risk.RiskRankingFieldFormula")
Issue issue = issue;
String riskProbabilityName = "Risk probability";
String riskConsequenceName = "Risk consequence";
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
try {
    List<CustomField> listOfConsequenceCustomFields = customFieldManager.getCustomFieldObjectsByName(riskConsequenceName);
    CustomField riskCustomField;
    if (listOfConsequenceCustomFields.isEmpty()) {
        throw new Exception("Could not find a custom field with name '" + riskConsequenceName + "'");
    } else {
        riskCustomField = listOfConsequenceCustomFields.get(0);
    }

    String consequenceTextValue = issue.getCustomFieldValue(riskCustomField);
    Integer consequenceNumberValue;

    switch (consequenceTextValue) {
        /** Insert new mappings after this line*/
        case "Low":
            consequenceNumberValue = 1;
            break;
        case "Medium":
            consequenceNumberValue = 2;
            break;
        case "High":
            consequenceNumberValue = 3;
            break;
        default: //Setting the value to zero will force the multiplication
            consequenceNumberValue = 0;
    }

    List<CustomField> listOfProbabilityCustomFields = customFieldManager.getCustomFieldObjectsByName(riskProbabilityName);
    CustomField probabilityCustomField;
    if (listOfProbabilityCustomFields.isEmpty()) {
        throw new Exception("Could not find a custom field with name '" + riskProbabilityName + "'");

    } else {
        probabilityCustomField = listOfProbabilityCustomFields.get(0)
    }
    String probabilityTextValue = issue.getCustomFieldValue(probabilityCustomField)
    Integer probabilityNumberValue;
    switch (probabilityTextValue) {
    /** Insert new mappings after this line*/
        case "Low":
            probabilityNumberValue = 1;
            break;
        case "Medium":
            probabilityNumberValue = 2;
            break;
        case "High":
            probabilityNumberValue = 3;
            break;
        default:
            probabilityNumberValue = 0;
    }
    /** Multiply both numbers values to receive a final Risk ranking as an integer*/
    Integer calculatedRiskRanking = probabilityNumberValue * consequenceNumberValue;
    return calculatedRiskRanking;

} catch (Exception e) {
    log.error("Caught exception: " + e);
//    e.printStackTrace()
    /** Return -1 to indicate that something did not go as planning in the algorithm*/
    return -1;
}

The result

This will add to Jira a Script field which has to be added to Jira view screens in order to see the result of the script.

Sorting capabilities

After adding the Script field, you need to configure the field to be sortable.

After this configuration you will be able to sort Jira Filters by the Risk ranking

Searching capabilities - requires additional configuration step

To enable searching by the "Risk ranking" field, there is one additional step required.

To configure this navigate to Custom fields configuration page in Jira administration.

On the Edit page set the Search Template to Number Searcher.

In order to see the effect, you need to perform the re-index of your Jira.

As a result, you will be able to query the data in Jira Filters

Have fun =) and in case of questions, contact uvia the Service Desk. We are always happy to help.