Can we load the risk assessment to the sn_risk_advanced_risk_assessment_instance table?

Snehal Madakatt
Mega Sage

Hi Team,

 

Can we load the old risk assessment data(risk assessment from excel) to sn_risk_advanced_risk_assessment_instance table instead of creating it manually by scoping? 

 

If we load the risk assessment data, will the roll up and risk aggregation still work  correctly?

 

I had tried to create the risk assessment for single record by background script, but few fields are not getting set eg:

SnehalMadakatt_0-1741161566802.png

var gr = new GlideRecord('sn_risk_advanced_risk_assessment_instance');
gr.initialize();
gr.number = 'Test4';
gr.entity_1 = "6d645eeb9f9892100de9fbda7a0a1cd2";
gr.risk = "26ae6f178373121030c971a6feaad397";
gr.risk_assessment_methodology = "03df5cf0dbbfc010c794187d139619ed";
gr.state = "7";

gr.summary_inherent_risk_score = "Medium (Score: 4)";
gr.summary_control_effectiveness_score = "Needs Improvement (Score: 2)";
gr.summary_residual_risk_score = "Medium (Score: 4)";

//gr.inherent_computed_risk_score = "Medium (Score: 4)";

gr.override_calculated_inherent_score = true;
gr.inherent_overridden_risk ="c8816074dbbfc010c794187d139619b1";

gr.override_calculated_control_effectiveness = true;
gr.control_overridden_effectiveness = "be52ac74dbbfc010c794187d1396198e";

gr.override_calculated_residual_score = true;
gr.residual_overridden_risk = "c4c540addb774410c794187d13961983";
//gr.residual_computed_risk_score = "Medium (Score: 4)";
gr.insert();

I was able to set below:

SnehalMadakatt_1-1741161607103.png

Need to know if we should load risk assessment data or not. If yes how? and it should rollup/ aggregate as OOB.

 

Regards,

Snehal

 

 

 

 

4 REPLIES 4

PrudeAnurag
ServiceNow Employee
ServiceNow Employee

Hello @Snehal Madakatt ,
If you wish to bring the Excel-based assessment into the advanced risk format, the above won't work. You will need to recreate the whole mechanism via script, initialising the assessment, loading the values for all of its factors and transitioning it via script through all the stages. 
For starters, use the triggerRiskAssessment function, and once you have the assessment id, then update the factor values in the assessment instance response table. 
If you do all of this properly, the assessment will appear in the workspace and roll up the scores. 

Regards,
Anurag


@PrudeAnurag Thank you for responding.

 

So as per my understanding the Risk assessment is created by scoping and its OOB complex logic that drives the risk assessment(with all the multiple linking that happens OOB) through states and then rollup and aggregation stuff that happens. 

 

When i tried to just load single record with few fields by 1.Data load & 2.Background script... the fields in assessment summary were not getting set despite its type is string...was able to set the overridden scores.

 

The data load of the risk assessment data which is already assessed from 3rd party tool(available in excel format) in service now is not possible is what I was thinking. But can you let me know what should be done for this case...should the assessment be manually generated? What should be the approach here then?

 

Can you explain bit more on what you suggested.

 

Regards,

Snehal.

@Snehal Madakatt, you will need to create the scope via script. 
Consider that you, as a person, are trying to perform the assessment. Start by creating the scope if it does not exist. Associate the risk to that scope. Later, you can start the assessment using the API. If you wish to understand the required parameters, debug the function triggerRiskAssessment, which will help you with all the mandatory parameters. Once initiated, you will have your assessment instance, which you can query on the instance response to populate all the factors and save it through the states. Once you move across the states, the auto calculation kicks in, and you will have all the needed scores. 
All of the mandatory factors must be filled in. If anything is skipped, the solution won't work. 
Use After Transform Script to mimic the whole procedure. 

There is no other way to load the external assessment for risk.

Regards,
Anurag

ok Thanks for responding Anurag.