- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2014 12:34 PM
I have found alot of talk around this issue, but haven't found anything specific on this. My group wants to have the result of the Risk Assessment (the raw score value) tracked on the CHANGE REQUEST so that they can do some statistical analysis on it over the long term.
My problem is that I can't find how to get to that Risk Score. I can see within the Risk Calculator scripts where the system is running a query against the Risk Assessment, but I don't see anywhere where there is a way (other than that query model) to get that value from the completed Risk Assessment, and then populate it in the Change Request form.
Any assistance on this would be really helpful. Thanks!
Chris O'Neill
CAI
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2014 01:02 PM
Hi Chris,
I did some digging and it doesn't look like that score is actually captured anywhere. If you wanted it on your change request you could add a new field and then put something like this in a before update business rule. Adding to a new business rule let's you have this functionality without updating any OOB functionality.
var score = 0;
var srGR = new GlideRecord('survey_response');
srGR.addQuery('instance.task', current.sys_id);
srGR.addNotNullQuery('answer_integer');
srGR.query();
while (srGR.next()){
score += srGR.answer_integer;
}
current.u_my_new_score_integer_field = score;
I grabbed most of that code from the calcCompositeScore() function in the RiskAssessmentCalculator script include.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2014 01:02 PM
Hi Chris,
I did some digging and it doesn't look like that score is actually captured anywhere. If you wanted it on your change request you could add a new field and then put something like this in a before update business rule. Adding to a new business rule let's you have this functionality without updating any OOB functionality.
var score = 0;
var srGR = new GlideRecord('survey_response');
srGR.addQuery('instance.task', current.sys_id);
srGR.addNotNullQuery('answer_integer');
srGR.query();
while (srGR.next()){
score += srGR.answer_integer;
}
current.u_my_new_score_integer_field = score;
I grabbed most of that code from the calcCompositeScore() function in the RiskAssessmentCalculator script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2014 10:26 AM
Thanks BRAD. That was how we eventually did it. Your original script led the way!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 01:52 PM
Hi Brad & Chris,
When you activate the Change Management Risk Assessment plugin a new column is added to the Change Request(change_request) table titled Risk value(risk_value). The script include 'RiskAssessmentCalculator' is also added, which is where the code Brad provided comes from. In the calculateRisk() function in that script include the risk_value field is set to the the result of the calcCompositeScore() function (Line 32).
You can add the Risk value field onto the Change Request form and when the OOB 'Execute Risk Calculation' UI Action is triggered it will populate the value.
Thanks!
-Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 02:45 PM
Robert,
Yes, we ended up doing something like that. We added a line that "stamps" the value from this as part of the Execution of the RISK CALCULATION. Its working like a charm.
The real reason behind this is a good one, as the customer is using the "raw" RISK SCORE to determine if their RISK SURVEY is actually producing the right results over time - taking 6 months of data to track back, and determine if they are accurately evaluting risks.
Thanks.
Chris