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

After giving read access to ITIL, login as an ITIL user and open sys_user_group.list and see, if the user is able to see the records.



Also in you script, line number8 , add gs.addInfoMessage('active flag is: '+chg.active);



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

Logged in as an itil user, they are able to see all the active groups, but not the inactive ones. As an admin I'm able to see the inactive ones as well. Also, the flag is returning false when selecting the ui action.



find_real_file.png


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.

That did it! Thank you!


Dominik Simunek
Tera Guru

Can you share the whole code of UI Action? I don't see any what happens afterwards you set current.assignment_group to empty value, do you call current.update() or create the new change request from the current object without saving current? That would help us to investigate.



Also you can enhance your code to this - using dot-walking instead of that GlideRecord (code snippet not tested):


if (!current.assignment_group.nil() && current.assignment_group.active == false) {


  current.assignment_group = '';


  // gs.addInfoMessage etc.


}



Best regards,


Dominik