Inactive records on incident need to be visible to itil role users only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2023 09:04 PM
Inactive records on incident need to be visible to ITIL role users only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2023 09:10 PM
HI @manoj1 ,
I trust you are doing great.
Create a new field on the Incident table to mark the record as inactive. Let's call this field "Inactive" (type: Boolean).
Define the ITIL role in ServiceNow if it doesn't exist already. You can do this by navigating to "User Administration" -> "Roles" and creating a new role named "ITIL".
In the Business Rule script, add a condition to check if the incident record is inactive and the current user has the ITIL role. If the condition is met, set the "Inactive" field to true; otherwise, set it to false. Here's an example of how the code could look:
(function executeRule(current, previous /*,...*/) {
if (current.active == false && gs.hasRole('itil')) {
current.inactive = true;
} else {
current.inactive = false;
}
})(current, previous /*, ...*/);
Create a new filter on the Incident table to display only inactive records. In the filter conditions, add a condition to check if the "Inactive" field is true. This will ensure that only inactive incidents are displayed in this filter.
Assign the new filter to the ITIL role users. This can be done by navigating to "System Definition" -> "Dictionary" -> "Attributes", finding the "Filter" attribute of the "sys_user_role" table, and adding the newly created filter to the ITIL role.
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
‎06-14-2023 09:15 PM
Hi Amit,
Thanks for asking.
I am doing good hope you are also doing great.
can you help me which business rule do we need to use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2023 09:16 PM
is this a customer requirement?
you can update the code in OOB query business rule for the same.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2023 09:18 PM
Hi Ankur,
yes this is customer requirment.
can you please me with the OOB query business rule name.