Script help needed..

Pramod5
Tera Contributor

Hi Experts , 

Good day!

Looking for Help in scripting part 

 

1. Incident changing to major(Major Incident state is Accepted)


2. while assigning to agent it should show popup and agent will type some text 
3.  Announcement should be displayed on Employee center

should be like below

Pramod5_0-1714638297560.png

Something wrong with the Script , when i am assigning to the agent Popup is not coming up

could you help to fix this ?

function addMessage(){
    var mimState = g_form.getValue('major_incident_state');
    var mimMessage = g_form.getValue('u_mim_message');
    var assignedTo = g_form.getValue('assigned_to');
    if( mimState == 'accepted' && assignedTo == ''){
    var confirm = new GlideModal('mim_message');
    confirm.setTitle('Add message related to the Major incident to be displayed on the Employee Service Centre');
    confirm.setPreference("return continueOK()", "submitData");
    confirm.setPreference("return continueCancel()", "cancelData");
    confirm.render();
}
else{
    gsftSubmit(null, g_form.getFormElement(), 'save_incident');

}

 

 

Can someone help me the scripting part please .!

1 REPLY 1

Brian Lancaster
Tera Sage

Its your if statement. You have assignedTo is empty based on your code. Do you perhaps mean to say assgedTo is not empty which would look like assignedTo != '' instead of assignedTo == ''.