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

Mark Roethof
Tera Patron
Tera Patron

Hi there,

You could expand your condition, checking if the close notes are filled. This would prevent showing the error over and over.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Can you please help me with the code!! 

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.

Hi Harshal,

 

There is already a data policy available but it is kept inactive.

When it is turned active user are not able to create incidents.

I tried the same data policy it was not working