Making Incident "Close Notes" not mandatory? I have it partially working . . .

Gerry Crumbley
Giga Expert

Helsinki OOB version has Close Code and Close Notes mandatory on Resolve or Close. I would like to just change Close Notes to NOT be mandatory.

        I have set: UI Policy > Make close info mandatory when resolved or closed (set to true) > UI Policy Actions > Close Notes > Mandatory is set to False

                  Close Code is set to True

So, I click resolve in an incident, Close Code is Mandatory RED and Close Notes is NOT mandatory red. Good, that's what I want - so I make a selection in Close Code drop down and click Resolve. THEN, Close Notes becomes Mandatory RED??

Am I missing a step or setting somewhere?

find_real_file.png

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Gerry,



There is an additional client script (BP) Close Mandatory on Close or Resolve which sets close notes field to mandatory. Please refer the same on your instance.


View solution in original post

14 REPLIES 14

what  kind of issue you are facing ?

You don't need to make mandatory false,set Mandatory to Leave Alone.

it will work definitely.

 

and if face any issue then share the issue,i will try to sort out.

and inactive 2 client script as below..

 

 

Mark correct or helpful if it helps you.

 

Warm Regards,

Pranay Tiwari

| www.DxSherpa.com | pranay.tiwari@dxsherpa.com |

In my case, its on a different table. The table name is[sn_customerservice_case]. Here's the problem now, there's no client script to make close_notes mandatory yet it still keeps throwing me "Please specify close notes". I tried having a UI policy to check for the state and make the field false for mandatory. . Tried to debug it and JS logs were as follows:

condition exited with: TRUE

Setting "mandatory" to "false" on "element" field

Looks fine but it still threw me the same error to "...specify notes"

So I decided to write a client script: 

function onSubmit() {
var action = g_form.getActionName();
if (action != 'close')
return;
jslog('action close ');
// Close notes and Close code must be on the form
if (!g_form.getControl('close_notes'))
return;
jslog('field close found ');


//g_form.setDisplay('close_notes', true);
g_form.setMandatory('close_notes', false);
// g_form.setDisplay('close_code', true);
//g_form.setMandatory('close_code', false);
if (g_form.getValue('close_notes') == '' )
return false;
jslog('end');

}

 

Now when I press Close button, it doesn't go through. The logs go through line jslog('field close found ')

g_form.setMandatory('close_notes', false) is never executed.

I have no idea where I'm going wrong. Any suggestions?