- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2025 12:20 AM
need to check the logged in user title exact matches the title which i declared in system property.
example;- created a system property with title like "FC Manager,Field Service Technician II,Manager, Field Service,MOT DC Manager,Senior Manager, Field Service,Sr Fabricator,Sr Field Service Technician,Sr Service Technician,Supervisor-Field Service" , suppose logged in user title is "SERVICE TECHNICIAN", it should not satisfy the condition, only satisfy the condition when logged in user title is "Field Service Technician II" or "Sr Service Technician".
Please help me out.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2025 02:22 AM
then store that in a string variable, use split and it gives you array and then search in that array using indexOf.
But storing in property is recommended, considering in future if any title is added/removed then you need not change the script.
I believe I have provided enough guidance on your question.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2025 02:18 AM
Hello @Ankur Bawiskar ,
If i want to add all title in script like var userlistofTitles = ['Automation Operations Manager', 'Branch Manager', 'Branch Sales Manager', 'Div Ops Support', 'Division Sales Center Manager', 'DivisionSupport', 'FC Warehouse Manager', 'Group Operations Support', 'On-Site Mgr', 'On-Site Senior Manager', 'On-Site Supv', 'Operations Manager', 'Sales Admin Supervisor', 'Sales Center Supervisor', 'Sales Center Supv', 'Service Shop Manager',
'Shop Mgr./MI Process Pump', 'Shop Operations Manager', 'Shop Supv', 'DC Manager', 'DC Supv', 'DC Whse Manager', 'FC Manager', 'Field Service Technician II', 'Manager, Field Service', 'MOT DC Manager', 'Senior Manager, Field Service', 'Sr Fabricator', 'Sr Field Service Technician', 'Sr Service Technician', 'Supervisor-Field Service', 'Warehouse Mgr', 'Br.Mgr/Montreal FP Shop', 'Ops. Mgr. / FPH / Toronto', 'Ops.Mgr./Belleville', 'Ops.Mgr./Brandon', 'Ops.Mgr./Calgary', 'Ops.Mgr./Red Deer', 'Ops.Mgr/Quebec City', 'Shop Supervisor', 'Sr. Machinist'
];,
Then what i need to add in the logic?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2025 02:22 AM
then store that in a string variable, use split and it gives you array and then search in that array using indexOf.
But storing in property is recommended, considering in future if any title is added/removed then you need not change the script.
I believe I have provided enough guidance on your question.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2025 01:09 AM
Hello @Ankur Bawiskar ,
Looged in user title is "Field Service Technician"