- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 12:08 AM
Hi Team,
I have got a requirement that, there is one field (Password) in the catalog item called "Password reset". After ticket creation, we generally see the password field in the Requester details under RITM form. In that RITM form I want it to be visible only for the specific group members. for rest of group members, it should be hidden in the Requester details section.
Conditions:
1. The field should be visible only to the specific assignment group members rest of members should be hidden.
I have tried creating a UI policies, but as the field is in the requester details, unable to select the field from the dropdown menu.
Can I know how can I achieve this?
Thanks in advance.
Nageshwari P.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 01:23 AM - edited 07-17-2025 01:26 AM
Hello @nageswari1 ,
@Ankur Bawiskar has already outlined the approach quite well, but since you specifically asked for steps, here’s a clear breakdown that you can follow to achieve this:
Step 1: Create a System Property
This will help you manage the group visibility without modifying scripts later.
-
Name: x.company.visible.password.group
-
Type: String
-
Value: (Enter the Sys ID of the assignment group whose members should see the field)
Step 2: Create a Display Business Rule on sc_req_item
This rule checks whether the logged-in user is a member of the allowed group and stores a flag in g_scratchpad.
(function executeRule(current, previous) {
var allowedGroupSysId = gs.getProperty('x.company.visible.password.group');
var isVisible = false;
var groupMember = new GlideRecord('sys_user_grmember');
groupMember.addQuery('user', gs.getUserID());
groupMember.addQuery('group', allowedGroupSysId);
groupMember.query();
if (groupMember.hasNext()) {
isVisible = true;
}
g_scratchpad.show_password = isVisible;
})(current, previous);
Step 3: Create an onLoad Client Script on sc_req_item
Use this script to control the visibility of the variable using the scratchpad value.
function onLoad() {
// Replace 'new_password' with the name (not label) of your variable
g_form.setDisplay('variables.new_password', g_scratchpad.show_password);
}
🔹 Please mark ✅ Correct if this solves your query, and 👍 Helpful if you found the response valuable.
Best regards,
Aniket Chavan
🏆 ServiceNow MVP 2025 | 🌟 ServiceNow Rising Star 2024
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 02:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 02:59 AM
Glat it worked @Nageshwari P @nageswari1 , please mark my response as helpful and accept my solution as well and close the thread so that it will help future readers to understand better.😊
Thank You!!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Glat it worked @nageswari1 @Nageshwari P , please mark my response as helpful and accept my solution as well and close the thread so that it will help future readers to understand better.😊
Thank You!!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2025 12:52 AM
Hello @nageswari1 / @Nageshwari P ,
I noticed earlier you said my solution worked for you so it would be great if you could mark my reply as helpful and accept it as the solution — that way it can also benefit others who come across the thread later.
Let me know if you need anything else!
Best regards,
Aniket Chavan
ServiceNow MVP 2025 | ServiceNow Rising Star 2024
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
HI @Aniket Chavan ,
Yes, it is worked but there is one more discrepancy, When I tried to preview the RITM ticket from SCTASK I am able to see the password field in the Requestor details. We need to hide the field in the preview option as well.