- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2022 05:32 AM
Hi All,
I have requirement to set a default question list for the resolution notes and then doing a character count before the incident is resolved.
The default questions on the resolve notes are to be set as :
Who resolved the call?
What was done to resolve the call?
Who verified that it is now working?
When the Incident gets resolved it should not have less than 150 characters and should not be the default value to ensure that the agents update the resolution. I found the below script on the community posts.
https://community.servicenow.com/community?id=community_question&sys_id=7f8d5510db7ab810770be6be13961975
This works great if there is no value in the Resolution notes. Is there a way for me to do this? I have not been able to find a solution.
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2022 04:14 AM
Hi
Try writing an onSubmit client script as below and check if its working
function onSubmit() {
var state = g_form.getValue('state');
if(state == '6')
{
if(g_form.getValue('close_notes').toString().length < 150)
{
g_form.showErrorBox('close_notes',"Please enter minimum 150 characters");
return false;
}
}
var notes = g_form.getValue('close_notes').toString();
if((notes.indexOf('Who resolved the call?') == -1) || (notes.indexOf('What was done to resolve the call?') == -1) || (notes.indexOf('Who verified that it is now working?') == -1) )
{
g_form.showErrorBox('close_notes',"Existing value in resolution notes cannot be removed");
return false;
}
}
Mark as correct and helpful if it works.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2022 04:37 AM
Hi,
The first part of the script is working perfectly and it is all that I need . The second part of the script checking is not working, but I do not have a need for the questions to be removed. Thank you for providing an answer.
var state = g_form.getValue('state');
if(state == '6')
{
if(g_form.getValue('close_notes').toString().length < 150)
{
g_form.showErrorBox('close_notes',"Please enter minimum 150 characters");
return false;
}
}