Incident template selection to be made mandatory

Santy19
Tera Contributor

Dear All,

 

Happy Friday!!!

Looking for some advise here.

 

We use both CSM and ITSM and I have a requirement to make selection of an incident template mandatory when the Incident is created from a Case.

 

How could I achieve this? Any guidance is appreciated.

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@Santy19 You can use the following script to make the template field mandatory.

 

function onLoad() {
    //Type appropriate comment here, and begin script below
    var parent = g_form.getReference('parent', callBackFunc);

    function callBackFunc(parent) {
        if (parent.sys_class_name == 'sn_customerservice_case') {
            g_form.setMandatory('u_template', true);
        }
    }
}

anshul_15
Tera Contributor

Hi @Sandeep Rajput 
Template is not the custom field but out of box template.
OOB there's an UI Action i.e Create Incident. When a user on a case form click on that UI action "Create Incident" an incident is created with case details. 
Now question is when we click on that UI action we want the template to be mandatory so that the fields in the incident will pre-populated according to the defined template.