- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday - last edited 4 hours ago
My users say they would like the fields on the related list Risk Assessment for their Change requests to just appear on the Change request form, vs clicking open from the Risk Assessment related list (screenshot)
I can't seem to figure out a way to do this? Is it even possible?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
When I went back to the team to ask *why* this is necessary, they explained that they want to make the risk assessment mandatory to advance the change request state. So their logic is transfer the mandatory risk assessment fields onto the change_request form and then they'll be mandatory to advance the request.
The correct way to address this is a business rule on the change_request table that triggers before state changes and checks that the related assessment instance is complete. Script for that:
(function executeRule(current, previous /*null when async*/) {
var assessmentinstance = new GlideRecord ('asmt_assessment_instance');
assessmentinstance.addQuery('task_id', current.sys_id);
assessmentinstance.query();
if(!assessmentinstance.next())
{
current.setAbortAction(true);
gs.addInfoMessage('Please complete the risk assessment related link before proceeding.');
current.state = 1; //check state value
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
But also, I'm willing to accept that "a custom ui upgrade requiring continuous maintenance" counts as a solution of "no don't do this" 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
It's a tough choice for some... but an easy one seen from my side 😉
But the UI formatter could be the "answer" if it's not NO 😛
ï’¡ If this pointed you in the right direction, hit Helpful to spread the good vibes.
✅ If it cracked the case for you, mark it Correct so the next person doesn’t have to reinvent the wheel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
When I went back to the team to ask *why* this is necessary, they explained that they want to make the risk assessment mandatory to advance the change request state. So their logic is transfer the mandatory risk assessment fields onto the change_request form and then they'll be mandatory to advance the request.
The correct way to address this is a business rule on the change_request table that triggers before state changes and checks that the related assessment instance is complete. Script for that:
(function executeRule(current, previous /*null when async*/) {
var assessmentinstance = new GlideRecord ('asmt_assessment_instance');
assessmentinstance.addQuery('task_id', current.sys_id);
assessmentinstance.query();
if(!assessmentinstance.next())
{
current.setAbortAction(true);
gs.addInfoMessage('Please complete the risk assessment related link before proceeding.');
current.state = 1; //check state value
}
})(current, previous);

