Configure Mandatory comment on cancellation in Incident Management

akhilaanil
Tera Contributor

I am currently working on configuring mandatory comment on cancellation in incident management. When an Incident is moved to Cancelled state, I would like an update of the Additional Comments fields to be mandatory so that the Caller is informed of exactly what has happened and why.
Actually, by default in the platform whenever we move the state to cancel and saving the record, the form goes read only and that additional comments view becomes hidden. Do i need to create a UI Policy, business rule or a client script? 

5 REPLIES 5

Dr Atul G- LNG
Tera Patron
Tera Patron

Yes, @akhilaanil   You can use UI policy or client script.

 

https://www.servicenow.com/community/incident-management-forum/mandate-additional-comments/m-p/24870...

 

https://www.servicenow.com/community/incident-management-forum/require-additonal-comments-when-incid...

 

https://www.servicenow.com/community/developer-forum/to-make-additional-comments-mandatory-when-stat...

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

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

Ankur Bawiskar
Tera Patron
Tera Patron

@akhilaanil 

how is user cancelling? Is that user changing the state value?

If yes then you can use UI policy for this

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

John Dahl
Tera Guru

You can use several different means of doing this. You can also mix different approaches to blend security and a better user experience. Keep in mind that a user who adds an additional comment as a separate action may still get a message if they do not included the comment at the same time they are trying to cancel the incident. For example:

 

- Setup a business rule that notifies the user and aborts the save if the state changes to cancelled and the additional comments are empty. This will work regardless of how the record is cancelled, but it will throw up an ugly "Invalid Update" error message. You should use this AND preempt the submission with one of the options below on the client side to provide a better user experience.

 

If you allow users to manually set the state field:

- Setup a UI policy to make the additional comments field mandatory when the state changes to cancelled.

 

If you have a UI Action to cancel the ticket:

- Setup an onSubmit client script to check the additional comments field, set it mandatory, prompt the user to add a comment, then stop the submission.

akhilaanil
Tera Contributor

I tried with UI Policy in PDI. It is working but when I tried on other instance the field" Additional comments" not showing mandatory? So, I checked with another field "work note", it is working. Is the issue is with the field "additional comment"???