How to set Additional Comments field mandatory to fill, whenever incident moved to canceled state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2025 05:52 AM
I have the following requirement:
Whenever an incident is moved to cancelled state, Additional Comments [comments] field should be mandatory to fill.
Let me know how it could be done, Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 12:31 AM
@Community Alums
for your below requirement why won't before update BR won't help?
Whenever an incident is moved to cancelled state, Additional Comments [comments] field should be mandatory to fill.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2025 12:29 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2025 12:38 AM - edited 10-01-2025 12:39 AM
Hi @Community Alums
You can try onChange Client Script when the State changes:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue == 8 ) { //Cancelled
g_form.setMandatory('comments', true);
} else {
g_form.setMandatory('comments', false);
}
}
If this resolve your problem please mark it as helpful and accept the solution.
Thank You!
