Query to find Service Template Associated to "All Accounts" (MSSQL & PGSQL)

Query to find Service Template Associated to "All Accounts" (MSSQL & PGSQL)

Tested in builds from PGSQL (14300) or MSSQL (14306)

Kindly execute the query under Report -> New Query Report to get the list of Service Template Associated to All Accounts.

select sd.name "Service Name", rtl.templatename "Service Template Name", rtl.comments "Template description", rtf.description "Description field"  from requesttemplate_list rtl 
LEFT JOIN requesttemplate_fields rtf ON rtl.templateid=rtf.templateid
LEFT JOIN ServiceTempAccMapping b ON rtl.TEMPLATEID = b.TEMPLATEID   
LEFT JOIN Categorydefinition cd ON rtf.categoryid=cd.categoryid 
LEFT JOIN subcategorydefinition scd ON rtf.subcategoryid=scd.subcategoryid 
LEFT JOIN itemdefinition id ON rtf.itemid=id.itemid 
LEFT JOIN Servicedefinition sd ON rtl.parent_Service=sd.serviceid 
where is_catalog_template='true' AND rtl.isdeleted='false' and accountid is NULL  order by 1

                    New to ADSelfService Plus?