My Request Filter default rule for HR Case not running Javascript

tahnalos
Kilo Sage

We have been trying to look into filtering for HR Cases in the Employee Centre.  While looking at the My Request Filters, we noticed that there is a piece of Javascript which appears to not be running at all.  See below:

tahnalos_0-1755307678701.png

I tried to go into hr_caseMyRequestFilterUtil which is what hr_caseOpenRequestFilterUtil is referring to and entered some gs.info lines into the code.  None of them show up in the information logs so I am relatively convinced that the filters are not kicking off the Javascript.  Is there any way to confirm if Javascript is not running on My Request filters?  Because it looks like this OOB code is no longer running.

 

Thanks

1 ACCEPTED SOLUTION

Juhi Poddar
Kilo Patron

Hello @tahnalos

 

We cannot add javascript code there. This filter is normally like other filters we see when trying to filter records in tables or adding filter condition in BR or UI policy.

 

Thank You 

Juhi Poddar 

View solution in original post

5 REPLIES 5

Juhi Poddar
Kilo Patron

Hello @tahnalos

 

We cannot add javascript code there. This filter is normally like other filters we see when trying to filter records in tables or adding filter condition in BR or UI policy.

 

Thank You 

Juhi Poddar 

This is an OOB filter, are you telling me that ServiceNow screwed up here?

Nikhil Bajaj9
Giga Sage

Hi @tahnalos ,

 

In the filters we can't add javascript code like this. From the screenshot i can see that you are trying to filter some specific Sys_IDs. Solution can be  - you can get the required sys_IDs using background scripts etc and then use these sys_Ids in the Filter.

 

If my answer helped you, please mark it solution accepted.

 

Regards,

Nikhil Bajaj

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

debendudas
Mega Sage

Hi @tahnalos ,

Please make sure that the Sandbox enabled checkbox is set as TRUE in your script include.

 

I have tried the same thing in my PDI with incident, and it worked, please find the below screenshots:

debendudas_0-1755326655116.png

 

debendudas_1-1755326679158.png

 

 

If this solution helps you then, mark it as accepted solution ‌‌✔️ and give thumbs up 👍