closure codes and closure notes are mandatory

Adarsh15
Giga Contributor

Hi,

I have a requirement where the user are able to close the incident from the list view without the closure notes and closure codes.

I need to make sure they should fill the close notes and close codes before resolving or closing the ticket.

I have tried different methods including data policy but it was not working. Finally I wrote an onCell edit client script which is as follows,

if(newValue == 6 || newValue ==7){
alert("Closure notes and Configuration Item are mandatory");
saveAndClose = false;
}else{
saveAndClose = true;
}
callback(saveAndClose);

Problem with this is like after inserting the close codes and close notes from list view still it is showing that alert.

Can anyone help me with the above code , where I can check if the close code and close notes are empty.

 

Thanks in advance

1 ACCEPTED SOLUTION

Harshal Gawali
Giga Guru

Hi Adarsh,

I have tried Data policy in my PDI & it is working fine. what condition are you adding in data policy?

For reference, check below screenshot.

find_real_file.png

Regards,

Harshal.

View solution in original post

13 REPLIES 13

Hi Ankur,

Yes actually there was an issue with data policy condition.

Thank you so much

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi

did you get chance to implement the client script which I have pasted in my previous reply. If you want to handle this dedicatedly with client script then just copy past that client script and script include.

Thanks ,

Gunjan


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

Hi Gunjan,

Still it was not working...

Baishamya Mishr
Kilo Explorer

Hello.

I have somewhat different issue. 
While some change requests are created, active=true, in the same time the close code is updated as Successful. Also in some cases, closed time and closed by is also getting updated while the ticket is active.

 

Any idea why we are seeing this certain behavior?