Query to display additional field associations with templates

Query to display additional field associations with templates

Use case

The reports shows in which templates the created additional fields are associated 

Query

select sd.name "Service Catalog Name",
           rt.templatename "Template name",
           fc.field_name "Fields" from requesttemplate_list rt
left join servicedefinition sd on sd.serviceid = rt.parent_service
left join form_customizer fc on fc.form_name = ('WorkOrder_' + rt.templatename)
where fc.index_tech >= 0 and fc.field_name='udf_sline_901'
order by 1

Go to Admin >> Service Catalog - Additional Fields/Incident - Additional Fields >> Note the API name for the additional field and replace it with the highlighted text in the query




DB: MSSQL 
Filter: None

Sample Table