Script include for If current logged in user in member of assignment group

DeepikaR1661877
Tera Contributor

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);

7 REPLIES 7

Hi @Ravi Gaurav ,

How can i call this script include to the ui action?

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/

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