- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 03:28 AM
Hello Experts,
In my catalog item there are some variables which are only avaliable in sctask form. So I have a requirement in which on the basis of particular group , I have to make the variables editable in (sctask) in my service catalog . suppose if a user is a member of that particular group then he can be able to fill that information over there in sctask form....Apart from that no- body can edit that variables..
Need script for this . Preferable (Script include and Client script)
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 03:42 AM
Hi,
you can use onLoad catalog client script + GlideAjax and check if logged in user is member of that group or not
this link has sample script
Is Memberof Group from Client side
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 03:38 AM
If you can use client scripts, you should also consider UI Policies, they have the same behavior as a "OnLoad" client script.
But, answering your question, you can create a client script, OnLoad, that will check the user groups by calling an GlideAjax function. For that you need to pass the user ID, and the current group of the sc_task.
On the script include, check if the pair UserID and group is present in the table "sys_user_grmember". If yes, than you can set the read-only to false.
You can define all of this in UI Policy, using the script part.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 03:42 AM
Hi,
you can use onLoad catalog client script + GlideAjax and check if logged in user is member of that group or not
this link has sample script
Is Memberof Group from Client side
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader