Creating a Report based on logged in User

Jags5
Mega Sage

I want to create a report where it take the user id and returns all the employees reporting to the user

Based on User => ReportsTo

And then I want to display all the incidents created by those users/ Assigned To those users, in a pie chart.

I tried adding Database View but no use.

Let me know if you solved similar problem.

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

Please use settings like this:

find_real_file.png

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

6 REPLIES 6

Allen Andreas
Administrator
Administrator

Hi,

You should be able to build a report on the Incident table and then use conditions such as:

opened_by.manager is javascript:gs.getUserID()

or

assigned_to.manager is javascript:gs.getUserID()

Please mark reply as Helpful/Correct, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Allen Andreas
Administrator
Administrator

Hi,

Please use settings like this:

find_real_file.png

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

And for explanation as to why I used "Opened by" versus "Created by" see this thread here: https://community.servicenow.com/community?id=community_question&sys_id=52aefebadbde97c0b61ff3231f96...

Essentially opened by allows for direct access to the user record, which we'd need to find their manager to check if the current person viewing the report is indeed their manager.

Created by is a string field that only logs their userid and doesn't have access to the user table, thus making a created by report based off the user manager, in basic reporting, is not possible without extensive steps that aren't really needed when Opened by is available.

Please mark reply as Helpful, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Allen .. thanks a lot for the help. Now I am looking at another scenario..not sure if this is really possible.

When I click on a piece of pie at my 1 st level, i want to open another pie and populate it with all the user who reporting to the piece I clicked on in 1 st level.

hope I am making sense. Like when higher up the management want to see a pie of all the people who are their direct reports and also navigate to one more level to see the people managed by their direct reports.