Hello,
I have been tasked to build a report on servicedesk plus that needs to provide information regarding the current mobile phone devices we have assigned to users.
I am able to get the following columns easily through the GUI:
Product Name | Phone Number | Asset State | User |
However It has been requested that on this report we need to enter the Executive Officer that the user ultimately reports to, this information is sort of available on AD in the sense of we ca see who the user reports to and then who they report to etc. AD is linked with service desk.
So the headers would look like this:
Product Name | Phone Number | Asset State | User | Reports to EO
Iphone | 07712345678 | In Use | Joe Bloggs | Joe Bloggs EO
I hope this makes sense and you are able to help.
the current code I have is:
- SELECT
- "cicd"."COMPONENTNAME" AS "Product Name",
- "resFields"."UDF_LONG1" AS "Phone Number",
- "cirest"."DISPLAYSTATE" AS "Asset State",
- "resUser"."FIRST_NAME" AS "User"
- FROM
- "SmartPhone"
- LEFT JOIN
- "Resources" "cires"
- ON "SmartPhone"."CIID"="cires"."CIID"
- LEFT JOIN
- "ComponentDefinition" "cicd"
- ON "cires"."COMPONENTID"="cicd"."COMPONENTID"
- LEFT JOIN
- "ResourceState" "cirest"
- ON "cires"."RESOURCESTATEID"="cirest"."RESOURCESTATEID"
- LEFT JOIN
- "ResourceOwner" "resOwn"
- ON "cires"."RESOURCEID"="resOwn"."RESOURCEID"
- LEFT JOIN
- "AaaUser" "resUser"
- ON "resOwn"."USERID"="resUser"."USER_ID"
- LEFT JOIN
- "Resource_Fields" "resFields"
- ON "cires"."RESOURCEID"="resFields"."RESOURCEID"
- WHERE
- (
- "cirest"."DISPLAYSTATE" COLLATE Latin1_General_CI_AS = N'In Use'
- )
- AND cires.CIID IS NOT NULL