Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Adding UI action Reject Major Incident Candidate into Service Operations Workspace

Luke James
Tera Contributor

Hi All, 

 

I have a requirement to ensure that the Reject Major Incident Candidate ui action is also visible in the Service operations workspace. I now have the ui action visible on the Service operations workspace, but when I click on it nothing happens. 

 

This is the script that is in the OOTB UI action script: 

function promptForRejectionReason() {
//checking for work_notes visibility
if(!g_form.getControl('work_notes')) {
getMessage('Cannot reject major incident candidate as \'Worknotes\' is not visible', function(msg) {
g_form.addErrorMessage(msg);
});
return false;
}
var dialog = new GlideModal('sn_major_inc_mgmt_mim_rejection_reason', false, 648, 250);
getMessage('Reject Major Incident Candidate', function(msg) {
dialog.setTitle(msg);
});
ScriptLoader.getScripts('/scripts/incident/glide_modal_accessibility.js', function() {
dialog.template = glideModalTemplate;
dialog.on('bodyrendered', function(event) {
glideModalKeyDownHandler(event, dialog.getID());
});
dialog.render();
});
//This dialog will be destroyed in UI Page 'sn_major_inc_mgmt_mim_rejection_reason'
}

//Code that runs without promptForRejectionReason
if(typeof window == 'undefined')
rejectMICOnConfirmation();

//Server-side code
function rejectMICOnConfirmation() {
current.major_incident_state = new sn_major_inc_mgmt.MajorIncidentTriggerRules().MAJOR_INCIDENT_STATE.REJECTED;
current.update();
gs.addInfoMessage(gs.getMessage('Major incident candidate {0} has been rejected.', current.getDisplayValue()));
action.setRedirectURL(current);
}
 
I need this to work in the workspace client script I think. How would this need to be modified to work within the service operations workspace? 
 
Kind Regards, 
 
Luke
3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

https://www.servicenow.com/community/developer-forum/adding-ui-action-reject-major-incident-candidat...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

shyamkumar VK
Kilo Patron

@Luke James , I have already added solution in other thread can you try that let me know if you need any assistance/help more

 

https://www.servicenow.com/community/developer-forum/adding-ui-action-reject-major-incident-candidat...

 

Regards,

Shyamkumar

 

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

Drew Carpenter
Tera Expert

The solution in those links doesn't work for Configurable Workspace, which SOW is.