Script include for If current logged in user in member of assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2024 10:55 PM - edited ‎08-23-2024 02:57 AM
Hi all,
I have the one recruitment , when the current logged in user having the "xyz" role, and the assignment group also having the same role if the condition is match then UI action visible to the incident table. i have write some code for that it's working inside the form when i am using gs.log method, but user having the role and and they not part of the assignment group even though the UI action are visible, any one help on this?
checkActionableUIActionVisibility: function(sirRecord) {
if (gs.hasRole('sn_si.sap_lob_analyst')) {
var groupSysId = sirRecord.assignment_group;
if (gs.getUser().isMemberOf(groupSysId)) {
return true;
}
}
return false;
},
UI Action condition
new ABC_SecurityIncidentUtil().checkActionableUIActionVisibility(current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2024 10:41 PM
Hi @Ravi Gaurav ,
How can i call this script include to the ui action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2024 12:08 AM
you can you
new <Script-Include-API-Name>.<Function-Name>();
can you please mark helpful and accept the solution its giving us motivation
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2024 02:47 AM
Hi @Ravi Gaurav ,
I have tried your script and i m try to print the logic it's triggered the table , but when i am calling the SI into UI action, it's not working, if the user having role and user is not part of the group even though the UI action are visible, but the script logic is working inside the form , but output is not getting