Incident-query(Need to remove mandatory fields while closing the incident)

khasim523169
Tera Contributor

Hi Team

i need to removed the mandatory fields (Resolution codes and Resolution notes ) , while closing the incident ..

how we can achieve these

 

Regards

khasim

 

 

4 REPLIES 4

RAMANA MURTHY G
Mega Sage
Mega Sage

Hello @khasim523169 ,

Please give some clarity about it. Do you want to make mandatory false to those fields or you want to delete those fields from form? 

 

If u want to make mandatory false to those fields you can use onChange client script or UI Policies, 

g_form.setMandatory('close_code',false);

g_form.setMandatory('close_notes',false);

 

If u want to delete fields from form, it is not possible to remove field, you can hide those fields using g_form.setVisible('close_code',false) or g_form.setDisplay('close_code',false)

 

Please mark my answer helpful & correct, if it helps you

Thank you

 

 

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer

Harish KM
Kilo Patron
Kilo Patron

Hi @khasim523169 OOB there are 2 scripts which makes these fields mandatory. You can deactivate the below scripts

  1. A Data Policy "Make close info mandatory when resolved or closed".
  2. A Client Script "(BP) Close Mandatory on Close or Resolve" that ensures that resolution code and resolution notes are mandatory onSubmit.
Regards
Harish

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @khasim523169 

 

May i know why you want to break the foundation validation? Res cat /code is a helpful information, that can help to improve the process.

 

It is OOTB

You can check the client script. 

*************************************************************************************************************
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]

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

Prathamesh G
Kilo Sage
Kilo Sage

Hello @khasim523169 ,

 

There is a OOB OnChange Client Script named 'Resolution details visibility on state' which is responsible to make the 'Resolution codes' and 'Resolution notes' mandatory. You can modify this Client script as per your business need.

 

If above solution resolve your issue, Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.

 

Thank You!

Prathamesh.