- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 11:53 AM
I have a requirement to create separate Risk and Impact assessments on Change Requests. I've seen some discussion around creating a separate survey and linking to that from a UI Action and that is my backup option.
What I'm hoping to make work (because it feels like the simplest solution) is to create multiple Risk Assessments.
Creating the Assessments is simple enough - the first runs when the Risk Value is null, the second one runs when the Risk Value is not Null. (I'll deal with valuing the second one later.)
The stumbling block is that when you click on the UI Action "Fill Out Risk Assessment", any existing assessments are deleted. I haven't been able to determine where that happens.
Here is the UI Action code. It's Geneva & OOTB:
function invokeAssessment() {
g_form.hideAllFieldMsgs();
var id = g_form.getUniqueValue();
var ga = new GlideAjax("CreateAssessment");
ga.addParam("sysparm_name", "checkAssessment");
ga.addParam("sysparm_id", id);
ga.addParam("sysparm_class", "change_request");
ga.getXMLAnswer(function(res) {
if (res == "No Condition")
g_form.addInfoMessage(getMessage("There are no risk assessments defined for this request"));
else {
var resArr = [];
resArr = res.split(",", 2);
var taskAsmtID = resArr[0];
var assessmentName = resArr[1];
var url = "survey_take.do?sysparm_survey=" + encodeURIComponent(assessmentName);
url += "&sysparm_task_assessment=" + taskAsmtID;
url += "&sysparm_survey_update=false";
url += "&sysparm_return_url=" + encodeURIComponent("/chg_risk_close_assessment_dialog.do?sysparm_stack=no");
url += "&sysparm_stack=no";
var d = new GlideOverlay({
title: getMessage("Risk Assessment"),
iframe: url,
width: "60%",
height: "80%",
onAfterLoad: function() {
d.autoDimension();
d.autoPosition();
d._createIframeShim();
}
});
d.render();
window.g_parentDialog = d; // Accessed from chg_risk_close_assessment_dialog UI page
}
});
}
I can't find anything in here (or a call to other code) to indicate where the existing assessment is removed. My hope is to comment out that code and see if that works. I don't plan to re-write the Risk Assessment script more than a simple tweak.
If anyone would point me in the right direction, that would be terrific.
TIA.
Sue
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 06:43 AM
Circling back on this issue.
Creating multiple risk assessments wasn't possible so I wound up creating a separate table for the Impact Assessment. I borrowed some of the functionality from Risk Assessment and added some of our own edit checks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 06:43 AM
Circling back on this issue.
Creating multiple risk assessments wasn't possible so I wound up creating a separate table for the Impact Assessment. I borrowed some of the functionality from Risk Assessment and added some of our own edit checks.