Can you change the orientation of a RAM's Heatmap?

AnthonyGates
Tera Contributor

This is more for esthetic purposes, but is it possible to modify the display of the Residual Heatmap built into a Risk Assessment Methodology (RAM) in such a way as to flip the y-axis so it runs in the opposite direction?

For example:

AnthonyGates_0-1768162488528.png

The RAM is configured for:

  • Inherent Risk, Control Effectiveness, and Residual Risk
  • Heatmaps are enabled for both Inherent and Residual Risk Assessment Types
  • Residual Risk is configured for:
    • Calculate based on - Inherent risk and control effectiveness
    • Qualitative scoring logic - Lookup matrix between inherent risk and control effectiveness

Thanks in advance.

 

 

 

 

 

2 ACCEPTED SOLUTIONS

SagnicDas_dev
Mega Guru

Hi @AnthonyGates ,

Hope you are doing well.

So I chceked your request this is not recommended to chnage the axis orientation.

It is not possible to modify the built-in ServiceNow Risk Assessment Methodology (RAM) Residual Heatmap display to flip the y-axis in the opposite direction (from 5 to 1 instead of 1 to 5) using standard configuration. The default display orientation of the axes within the out-of-the-box risk heatmap component is fixed by the system design. 
The standard configuration for heatmaps uses a fixed layout where scores typically increase from bottom to top and left to right. Your provided image illustrates the current (standard) layout and your desired aesthetic, but the desired visual is not achievable with the current built-in functionality. 
While you cannot flip the axis direction, you can configure other aspects of the heatmap, such as:
  • Axis Factors: Defining which factors (Impact, Likelihood, Control Effectiveness) are used for the X and Y axes.
  • Color Definitions: Adjusting the colors that correspond to different risk levels (Low, Medium, High).
  • Scoring Logic: Customizing how the scores are calculated (e.g., lookup matrix, script). 


But If you want to convert 5x5 to 6x6 or vice versa .yes that is possible.

If you find the answer Useful please mark it as Helpful.

Regards,

Sagnic

View solution in original post

Hi @AnthonyGates ,

In one of our recent requirement Client Requested that they will give the assessment based on 6 factors but in the Hitmap it must show the details in 5x5 format.

We need to create a Business rule to map the 5x5 Matrix to 6x6.

Conditions : 

Table : 

Risk Assessment Instance Response [sn_risk_advanced_risk_assessment_instance_response]


When : After
Action : Insert, Update
Condition : Assessment Instance.Risk Assessment Methodology  is  ( Select your Assessment Methodolody )


Code :

(function executeRule(current, previous /*null when async*/ ) {


    var sys = current.assessment_instance_id;
    var rec = new GlideRecord("sn_risk_advanced_risk_assessment_instance");
    rec.get(sys);

    var res = new GlideRecord("sn_risk_advanced_risk_assessment_instance_response");
    res.addQuery("assessment_instance_id", rec.sys_id);
    res.orderBy("sys_updated_on");
    res.query();

    while (res.next()) {
        var type = res.getValue("assessment_type");
        if (type == 1) {
            if (res.factor.getDisplayValue() == "Impact  (ERM RAM 6x6: MOE (With Inherent))") {
                var impact = res.getValue("qualitative_response");
                var calcImpact = res.getValue("u_normalized_score1");
                //normImpact = parseInt(normImpact);
            }
            if (res.factor.getDisplayValue() == "Likelihood (ERM RAM 6x6: MOE (With Inherent))") {
                var likelihood = res.getValue("qualitative_response");
                var calcLikelihood = res.getValue("u_normalized_score1");
                //normLikelihood = parseInt(normLikelihood);
            }
        } else if (type == 3) {//
            if (res.factor.getDisplayValue() == "Impact  (ERM RAM 6x6: MOE (With Inherent))") {
                var impactResidual = res.getValue("qualitative_response");
                var calcImpactResidual = res.getValue("u_normalized_score1");
                //normImpact = parseInt(normImpact);
            }
            if (res.factor.getDisplayValue() == "Likelihood (ERM RAM 6x6: MOE (With Inherent))") {
                var likelihoodResidual = res.getValue("qualitative_response");
                var calcLikelihoodResidual = res.getValue("u_normalized_score1");
                //normLikelihood = parseInt(normLikelihood);
            }
        }
    }
    // gs.info("Residual BinitaImpact " + calcImpactResidual);

    // gs.info("Residual  BinitaLikelihood " + calcLikelihoodResidual);
    var inherent = calcImpact * calcLikelihood;
    var residual = calcImpactResidual * calcLikelihoodResidual;

    // gs.info("Residual  Binitainherent " + residual);
    var inherentRating = "";
    var residualRating = "";

    if (type == 1) {
        if (inherent > 0 && inherent <= 6) {
            inherentRating = "Low";
        } else if (inherent > 6 && inherent <= 13) {
            inherentRating = "Moderate";
        } else if (inherent > 13 && inherent <= 19) {
            inherentRating = "High";
        } else if (inherent > 19 && inherent <= 25) {
            inherentRating = "Very High";
        }

        rec.setValue("u_computed_impact_score", impact);
        rec.setValue("u_computer_likelihood_score", likelihood);
        rec.setValue("u_calculated_impact", calcImpact);
        rec.setValue("u_calculated_likelihood", calcLikelihood);
        rec.setValue("u_calculated_inherent_score", inherent);
        rec.setValue("u_calculated_inherent_rating", inherentRating);
        rec.update();


    } else if (type == 3) {
        if (residual > 0 && residual <= 6) {
            residualRating = "Low";
        } else if (residual > 6 && residual <= 13) {
            residualRating = "Moderate";
        } else if (residual > 13 && residual <= 19) {
            residualRating = "High";
        } else if (residual > 19 && residual <= 25) {
            residualRating = "Very High";
        }

        rec.setValue("u_computed_impact_residual", impactResidual);
        rec.setValue("u_computed_likelihood_residual", likelihoodResidual);
        rec.setValue("u_calculated_impact_residual", calcImpactResidual);
        rec.setValue("u_calculated_likelihood_residual", calcLikelihoodResidual);
        rec.setValue("u_calculated_residual_score", residual);
        rec.setValue("u_calculated_residual_rating", residualRating);
        rec.update();
    }

})(current, previous);

 
Use the code above and if you get it helpful please markit as helpful.

Regards,


Sagnic

View solution in original post

6 REPLIES 6

SagnicDas_dev
Mega Guru

Hi @AnthonyGates ,

Hope you are doing well.

So I chceked your request this is not recommended to chnage the axis orientation.

It is not possible to modify the built-in ServiceNow Risk Assessment Methodology (RAM) Residual Heatmap display to flip the y-axis in the opposite direction (from 5 to 1 instead of 1 to 5) using standard configuration. The default display orientation of the axes within the out-of-the-box risk heatmap component is fixed by the system design. 
The standard configuration for heatmaps uses a fixed layout where scores typically increase from bottom to top and left to right. Your provided image illustrates the current (standard) layout and your desired aesthetic, but the desired visual is not achievable with the current built-in functionality. 
While you cannot flip the axis direction, you can configure other aspects of the heatmap, such as:
  • Axis Factors: Defining which factors (Impact, Likelihood, Control Effectiveness) are used for the X and Y axes.
  • Color Definitions: Adjusting the colors that correspond to different risk levels (Low, Medium, High).
  • Scoring Logic: Customizing how the scores are calculated (e.g., lookup matrix, script). 


But If you want to convert 5x5 to 6x6 or vice versa .yes that is possible.

If you find the answer Useful please mark it as Helpful.

Regards,

Sagnic

Thank you. This does confirm what I suspected.

Just for my own understanding… When you said converting from 3x5 to 5x5 or 6x6, does that mean I could change the orientation as per my original post? If so, I would love to know how to do this, and what steps to take to do so.

 

Thanks

Hi Sagnic,

 

Thank you for your response. It confirms much of what I already suspected.

 

Just for my own understanding...

When you say, "But If you want to convert 5x5 to 6x6 or vice versa .yes that is possible." Does this mean that altering the Residual Risk Heatmap scale would enable me to configure the orientation of the Heatmap Axes?

If so, I would be keen to understand how this would work, and the steps involved in to make this a reality. Do you have a link, or any instructions you could provide to clarify?

 

Thanks,

Anthony

Hi @AnthonyGates ,

In one of our recent requirement Client Requested that they will give the assessment based on 6 factors but in the Hitmap it must show the details in 5x5 format.

We need to create a Business rule to map the 5x5 Matrix to 6x6.

Conditions : 

Table : 

Risk Assessment Instance Response [sn_risk_advanced_risk_assessment_instance_response]


When : After
Action : Insert, Update
Condition : Assessment Instance.Risk Assessment Methodology  is  ( Select your Assessment Methodolody )


Code :

(function executeRule(current, previous /*null when async*/ ) {


    var sys = current.assessment_instance_id;
    var rec = new GlideRecord("sn_risk_advanced_risk_assessment_instance");
    rec.get(sys);

    var res = new GlideRecord("sn_risk_advanced_risk_assessment_instance_response");
    res.addQuery("assessment_instance_id", rec.sys_id);
    res.orderBy("sys_updated_on");
    res.query();

    while (res.next()) {
        var type = res.getValue("assessment_type");
        if (type == 1) {
            if (res.factor.getDisplayValue() == "Impact  (ERM RAM 6x6: MOE (With Inherent))") {
                var impact = res.getValue("qualitative_response");
                var calcImpact = res.getValue("u_normalized_score1");
                //normImpact = parseInt(normImpact);
            }
            if (res.factor.getDisplayValue() == "Likelihood (ERM RAM 6x6: MOE (With Inherent))") {
                var likelihood = res.getValue("qualitative_response");
                var calcLikelihood = res.getValue("u_normalized_score1");
                //normLikelihood = parseInt(normLikelihood);
            }
        } else if (type == 3) {//
            if (res.factor.getDisplayValue() == "Impact  (ERM RAM 6x6: MOE (With Inherent))") {
                var impactResidual = res.getValue("qualitative_response");
                var calcImpactResidual = res.getValue("u_normalized_score1");
                //normImpact = parseInt(normImpact);
            }
            if (res.factor.getDisplayValue() == "Likelihood (ERM RAM 6x6: MOE (With Inherent))") {
                var likelihoodResidual = res.getValue("qualitative_response");
                var calcLikelihoodResidual = res.getValue("u_normalized_score1");
                //normLikelihood = parseInt(normLikelihood);
            }
        }
    }
    // gs.info("Residual BinitaImpact " + calcImpactResidual);

    // gs.info("Residual  BinitaLikelihood " + calcLikelihoodResidual);
    var inherent = calcImpact * calcLikelihood;
    var residual = calcImpactResidual * calcLikelihoodResidual;

    // gs.info("Residual  Binitainherent " + residual);
    var inherentRating = "";
    var residualRating = "";

    if (type == 1) {
        if (inherent > 0 && inherent <= 6) {
            inherentRating = "Low";
        } else if (inherent > 6 && inherent <= 13) {
            inherentRating = "Moderate";
        } else if (inherent > 13 && inherent <= 19) {
            inherentRating = "High";
        } else if (inherent > 19 && inherent <= 25) {
            inherentRating = "Very High";
        }

        rec.setValue("u_computed_impact_score", impact);
        rec.setValue("u_computer_likelihood_score", likelihood);
        rec.setValue("u_calculated_impact", calcImpact);
        rec.setValue("u_calculated_likelihood", calcLikelihood);
        rec.setValue("u_calculated_inherent_score", inherent);
        rec.setValue("u_calculated_inherent_rating", inherentRating);
        rec.update();


    } else if (type == 3) {
        if (residual > 0 && residual <= 6) {
            residualRating = "Low";
        } else if (residual > 6 && residual <= 13) {
            residualRating = "Moderate";
        } else if (residual > 13 && residual <= 19) {
            residualRating = "High";
        } else if (residual > 19 && residual <= 25) {
            residualRating = "Very High";
        }

        rec.setValue("u_computed_impact_residual", impactResidual);
        rec.setValue("u_computed_likelihood_residual", likelihoodResidual);
        rec.setValue("u_calculated_impact_residual", calcImpactResidual);
        rec.setValue("u_calculated_likelihood_residual", calcLikelihoodResidual);
        rec.setValue("u_calculated_residual_score", residual);
        rec.setValue("u_calculated_residual_rating", residualRating);
        rec.update();
    }

})(current, previous);

 
Use the code above and if you get it helpful please markit as helpful.

Regards,


Sagnic