Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Risk and Impact calculation in change request

ServiceNow10sun
Giga Guru

Hi All, 

 

I have requirement of  Calculating Risk based on 2 set of questionnaire example 5 questionnaire related to risk and risk should get calculated and another set of questions based on which impact should get calculated and based on these results risk and impact again a new "New Risk" ( Customized field) field should calculated.

 

I am able to create single assessment using the Risk assessment plugin  and its calculating risk field, however my client a questionnaire of impact as well . How to achieve this. Means based on 2 assessments the final result should get populated. 

Example - Risk  is low as per  the assessment and impact is Moderate then in the field " New Risk" result should be "Minor".

Is it possible?

 

 

6 REPLIES 6

Amit Gujarathi
Giga Sage

HI @ServiceNow10sun ,
I trust you are doing great.

 

Here's an example script that you can adapt to calculate the "New Risk" field:

 

(function() {
    // Get the values of risk and impact assessments
    var risk = current.risk_assessment_field; // Replace with the actual field name for risk assessment
    var impact = current.impact_assessment_field; // Replace with the actual field name for impact assessment

    // Define mapping of risk and impact levels to the "New Risk" levels
    var riskMapping = {
        'Low': {
            'Low': 'Minor',
            'Moderate': 'Minor',
            'High': 'Moderate',
            'Very High': 'Significant'
        },
        'Moderate': {
            'Low': 'Minor',
            'Moderate': 'Moderate',
            'High': 'Significant',
            'Very High': 'High'
        },
        'High': {
            'Low': 'Moderate',
            'Moderate': 'Significant',
            'High': 'High',
            'Very High': 'Critical'
        },
        'Very High': {
            'Low': 'Significant',
            'Moderate': 'High',
            'High': 'Critical',
            'Very High': 'Critical'
        }
    };

    // Set the value of the "New Risk" field based on risk and impact assessments
    var newRisk = riskMapping[risk][impact];

    // Update the "New Risk" field
    current.new_risk_field = newRisk; // Replace with the actual field name for the "New Risk" field
})();
 

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Hello,

Is this based upon a br on the assessment table?

Thanks,

Chad