The CreatorCon Call for Content is officially open! Get started here.

What's the easiest way to detect if a Risk Assessment has not been filled out?

frappe
Kilo Expert

What's the easiest way to determine if a Risk Assessment and been filled out and completed for a particular Change Request?

My process requires that the Business Rule named Calculate Risk is run by default for each update.   This means I can't use a simple method where say I check if the Risk field is empty since Calculate Risk will be looking for Risk Conditions and updating that field even though the user may not have filled out a Risk Assessment yet.

Ideally when the user clicks a Request Approval button it will check if the assessment has been completed and alert the user if not.  

Thanks

6 REPLIES 6

Michael Fry1
Kilo Patron

You could add the Task Assessment -> Task related list to your change and see if one has been completed.


Thanks Michael.   I am looking for a way to programatically check, i.e.   does Risk Assessment have a True/False field to say if it has been completed or not.  


I found this Advanced Java scripting deck https://jamesn903.files.wordpress.com/2014/04/16la5-scripting301.pdf     (Lab 3 page 26) that just happened to have some really great information on Risk Assessment in general.   In this deck it appears you need to create your own custom field to store a True/False value for if a Risk Assessment has been done but maybe there's another way.




I was asked to build a solution to a similar process.   In our change management process, you have to submit the risk assessment before the request can be considered for approval and we didn't necessarily want people to come back and change their assessment after the approval request was submitted.   The only way we could figure out it the risk assessment was taken was by creating a field on the change table named "risk assessment attempted" and marking the value as true once the person invoked the createAssessment script include.



The other requirement was to make sure that the change request had completed all of the fields on the risk assessment and in the version of ServiceNow we originally were working in, which was Fuji, there was a problem where you could set assessment fields as manadatory but the system did not enforce the condition so we ending up built a step into the request approval button that validates that all 8 questions on our risk assessment are completed.



In your case, you could add a field to the change request that defaults to false but updates to true when the assessment is taken.   I would think that you could change the value in the of the risk assessment field using the createAssessment script include.   When the user clicks on the request approval button, you could read the value of the field and if it's still false, give them an alert and stop the request approval process.  


Thanks, that's what I thought.   I will give this a try next.     This is definitely a candidate to add to a future releases of ServiceNow rather than making folks create their own field to calculate if an assessment has been taken.