UI Action Visibility
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 12:38 PM
Close button in change request form need to visible to the member of the group Approval related list , what condition I need to add in button can you please help me in this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 01:56 PM - edited 02-21-2023 01:57 PM
Hi,
Apply the UI Action's condition, check the current logged in user is member of specific group or not. You can use AND / OR operator if groups are more than one.
gs.getUser().isMemberOf('IT-Infrastructure-Management')
Please mark helpful and correct answer if it helps you.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 05:41 PM
Hi @Arjun Kumar Le1 ,
Because close button is an OOB button, don't try to edit anything on the same.
Create a new button on change request form with the same name and action_name it will hide the oob button and make the custom one visible.
Then coming to the condition which you need to mention.
As it is not straightforward requirement, you need to call a script include from condition field. In that script include you need to glide to group approval table and query it based on the change request and fetch the details.
Let me know if you need any help in scripting the solution mentioned above.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 03:12 AM
Thanks Basheer,
I need help in the Script , Can you please provide me script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 07:40 AM
I have written the below script include, please let me know what condition i need to add in the UI Action to call the script include.
var MyScriptInclude = Class.create();
MyScriptInclude.prototype = {
initialize: function() {},
isApprovalGroupMember: function() {
// Check if the current user is a member of the Approval group
var approvalGroup = GlideRecord('sys_user_group');
approvalGroup.addQuery('name', 'Approval');
approvalGroup.query();
if (approvalGroup.next()) {
var members = GlideRecord('sys_user_grmember');
members.addQuery('group', approvalGroup.sys_id);
members.addQuery('user', gs.getUserID());
members.query();
if (members.next()) {
return true;
}
}
return false;
}
};