I want to fetch Impact value in the residual assessment for the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
In Residual assessment we need to write a script that uses impact and likelihood values, but we get aggegrated inherent score as variable how can i fetch the value (or factor value) for each impact or likelihood in residual assessment to get that in script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @rishikaarya ,
In Residual Assessment, the script usually gives you the aggregated inherent score, but individual Impact and Likelihood factor values are not directly available in the script variables. To fetch these values, you need to query the factor response records related to the current assessment instance.
You can retrieve the Impact and Likelihood values by querying the sn_risk_advanced_factor_response (or asmt_assessment_instance_question, depending on your IRM setup) using the current residual assessment instance and then filtering the factors by name.
var impact = '';
var likelihood = '';
var factorGR = new GlideRecord('sn_risk_advanced_factor_response');
factorGR.addQuery('assessment_instance', current.sys_id);
factorGR.query();
while (factorGR.next()) {
if (factorGR.factor.name == 'Impact') {
impact = factorGR.factor_value;
}
if (factorGR.factor.name == 'Likelihood') {
likelihood = factorGR.factor_value;
}
}
gs.info('Impact Value: ' + impact);
gs.info('Likelihood Value: ' + likelihood);
- Residual assessment script only provides aggregated score.
- Individual factor values are stored in factor response table.
- Query the factor response table using the assessment instance.
- Filter Impact and Likelihood factors and use them in your residual calculation script.
This way you can fetch each Impact and Likelihood factor value and use it in the residual assessment script instead of relying only on the aggregated inherent score.
Hope this helps!
