Find manager and Manager-1 in the user hierarchy

Raj Rajpoot
Tera Contributor

Hi All,

I need some help to design a solution. Tried few community solution already but didn't get the correct results.

 

In my use case,

There is a list of 5 managers in sys_user table so I know the sys_id or name of the managers and storing them in a system property.

I need the logic where caller's manager field can loop through till any of the given 5 managers are found (matches with sys_id or name) but level could be anything.

For example, for Caller A manager 1 could be at 5th level in the hierarchy and for other Caller B the same manager could be at 7th level.

Caller A > M1 > M2 > M3> M4 .....> M(N-1) > M(N = 1 of 5 given managers)

I want to return manager sys_id (N) and and a level below (N-1) manager's sys_id, in 2 different reference fields on the incident form.

 

Thank you

0 REPLIES 0