Hi, I am new to Snow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2023 03:29 AM
Create a before query on the business rule on an incident table, such that users who are having itil role, should see only ACTIVE incidents.
It will be helpful
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2023 03:55 AM
Hi @chaithraravi,
I would highly discourage that logic.
In my experience users often look back to older incidents, to find out how something was solved.
Inactive incidents can be used by problem management to find out trends.
I probably could give you some more reasons, but I think you get the idea. 😉
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2023 06:38 AM
HI @chaithraravi ,
I trust you are doing great.
You can use below script for the same
(function executeRule(current, previous /*null when async*/) {
// Check if the user has the 'itil' role
if (gs.hasRole('itil')) {
// Add a condition to the query to only show ACTIVE incidents
current.addQuery('state', '=', '1'); // Assuming '1' is the value for ACTIVE state in your instance
}
})(current, previous);
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2023 06:39 AM
HI @chaithraravi ,
I trust you are doing great.
You can use below script for the same
(function executeRule(current, previous /*null when async*/) {
// Check if the user has the 'itil' role
if (gs.hasRole('itil')) {
// Add a condition to the query to only show ACTIVE incidents
current.addQuery('state', '=', '1'); // Assuming '1' is the value for ACTIVE state in your instance
}
})(current, previous);
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi