UI Action only working when admin

akunk23
Kilo Contributor

We have a "Copy Change Request" UI Action that copies over specific fields to a new request. However, we made some groups inactive and added some code to the script to check if the assignment group is active or not and if not throw a message to the user. When an admin uses the UI action, it works perfectly. However, if a normal ITIL user hits the button, it will copy over the previous group even if it is inactive. There are no ACL's on the ui action either. Below is a code snippet that works for admins but not itil users. Ideas why? Thanks!

find_real_file.png

1 ACCEPTED SOLUTION

There is a business rule on group table, which restricts it. You need to update this table to allow for itil users as well.



Make sure it doesnt affect you task table. assignment_group field in task table should have filter active=true



find_real_file.png



Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

9 REPLIES 9

Ivano B
ServiceNow Employee
ServiceNow Employee

Hi Akunk



Quick question. Did you check the active field content of the group you are trying to update ?


Your condition says cgh.active == false, but if the field has never being touched the content is null not false.


I would suggest try to implement a different logic



cgh.active != true



Try and let me know. I hope this will solve your issue and if it does please mark it


Cheers


R0b0


SanjivMeher
Kilo Patron
Kilo Patron

Why not add one more line in line 5


chg.addQuery('active',true);



Please mark this response as correct or helpful if it assisted you with your question.

SanjivMeher
Kilo Patron
Kilo Patron

or use if (chg.active!=true) in line 9 instead of chg.active == false



One more catch here.


ITIL users may not have access to group table. This could be an access issue also.


You may need to give access to ITIL users to Read sys_user_group table.



Please mark this response as correct or helpful if it assisted you with your question.

Thanks for the responses, however I still get the same result. Tried changing the script and adding a read role to the sys_user_group table for ITIL members and still only works for an admin.