Dynamic filter using script include to get a manager's Reportees

Shreya2
Giga Contributor

I am trying to create a dynamic filter for user reference field. It is meant to fetch a manager's reportees. I have written a script include for that and then called the function in the dynamic filter. Although, it does not seem to be working. I have tried adding sys logs but nothing gets captured.

find_real_file.png

 

find_real_file.pngfind_real_file.png

 

When I use the filter, Assigned to filters down the empty. I have a feeling that the return statement isn't correct. 

 

FYI, I am trying to use that filter in the below variable.

find_real_file.png

1 ACCEPTED SOLUTION

Brian Lancaster
Tera Sage

I don't think you need a script include for this.  You can just dot walk assigned_to.manager is (dynamic) Me.

find_real_file.png

View solution in original post

4 REPLIES 4

Elijah Aromola
Mega Sage

Try changing your return to:

manager + "=" + gr.sys_id

Brian Lancaster
Tera Sage

I don't think you need a script include for this.  You can just dot walk assigned_to.manager is (dynamic) Me.

find_real_file.png

Ahmmed Ali
Mega Sage
Mega Sage

Please correct me if my understanding is wrong.

 

your use case is, when any user opens incident list, you want to show incidents assigned users who reports to him/her. If this is use case then you can directly set condition as assigned to.manager isDynamic me

 

find_real_file.png

 

Thanks,

Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Hi 

Try this in Dynamic Filter Options  

Script : 

new MyReportees().reporteesName();

 or 

gs.include('MyReportees');new MyReportees().reporteesName();

and return 

manager + "=" + gr.sys_id

 

Mark it correct/helpful if it helps you

Regards,
Vaibhav Chaudhari