Confidential business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 08:50 AM
I created a before business rule that hides fields when a ticket it assigned to a specific group
Condition - !gs.getUser().isMemberOf('<group name>')
(function executeRule(current, previous /*null when async*/ ) {
var grp = current.addNullQuery('assignment_group').addOrCondition('assignment_group','!=','<group name>');
})(current, previous);
It does hide the short description, description, and notes as expected. The problem is it hides them from everyone, how do I reverse the rule so it is not hidden when assigned to the appropriate group?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 09:19 AM
Hi @RobertPC ,
Use below script,
(function executeRule(current, previous /*null when async*/ ) {
if (current.assignment_group != groupNamesysid) {
current.setDisplayValue('short_description', false);
current.setDisplayValue('description', false);
current.setDisplayValue('comments', false);
}
})(current, previous);
Please mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 09:23 AM
Hi Robert,
That is in your condition, isn't it
Condition - current.assignment_group == '<Group>'
Script
(function executeRule(current, previous /*null when async*/ ) {
if(!gs.getUser().isMemberOf('<group name>')) // this is the group that should see it
{
var grp = current.addNullQuery('assignment_group').addOrCondition('assignment_group','!=','<group name>');
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 09:30 AM
Do you want hide field s on form or don't want show particular records for a group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 09:31 AM
If you want to hide fields on form try with UI policy or Client script
if you want dont show particular records then try query business rule