Go to config variable and in default value give below code.
javascript: gs.getUser().getDepartmentID()
Auto-populate field on Catalog Item Form with logged in User Department ServiceNow
Working Code Asked question August 8, 2023
Go to config variable and in default value give below code.
javascript: gs.getUser().getDepartmentID()