- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 06:23 PM
Hi all,
I have a business rule that governs the visibility of the case to the users. Currently , it makes the case visible only to users with ITIL access . But additionally, want to make the case visible to users when they have opened the case even if they don't have any role in the system.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 06:51 AM - edited 10-09-2023 06:52 AM
If you don't mind, in the future, please always try and provide any script if it's there already. Additionally, include any screenshots as well as we don't know what all you have set and then we have to ask, which causes additional replies, etc.
For this, this would be the section to edit because this is for people who don't have the itil role (although I would add a closing parenthesis in that else if line because it's missing one on the end ). If possible, I would recommend speaking to whoever may have edited this originally and get with them for assistance, but outside of that, you could try adding:
+^NQfield_name='+gs.getUserID();
at the end, in place of the current semi-colon after getPersonnelNumber. You'd need to replace field_name with the appropriate field on the record of course.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 06:31 PM
Hi,
I assume this is a query business rule? If so, you'd want to evaluate if the user does not have the role, and if so, set their query to opened by is gs.getUserID().
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 06:53 PM
Thanks Allen. I'm quite new to the scripting world....There is already an 'else if' condition like below . Should I amend the below
else if (!gs.hasrole('itil') {
var query = u_catalog_item.ref_sc_cat_item_producer.u_can_read_requested_by=true^u_requested_by.employee_number='+getPersonnelNumber+'^NQu_catalog_item.ref_sc_cat_item_producer.u_can_read_requested_for=true^u_requested_for.employee_number='+getPersonnelNumber+'^NQu_catalog_itemISEMPTY^u_requested_by.employee_number='+getPersonnelNumber;
var currentQuery = current.getEncodedQuery();
if(currentQuery) {
query = query.replace(/\^NQ/g, '^' + currentQuery+ '^NQ');
query = query + '^' + currentQuery;
}
current.addEncodedQuery(query);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 06:51 AM - edited 10-09-2023 06:52 AM
If you don't mind, in the future, please always try and provide any script if it's there already. Additionally, include any screenshots as well as we don't know what all you have set and then we have to ask, which causes additional replies, etc.
For this, this would be the section to edit because this is for people who don't have the itil role (although I would add a closing parenthesis in that else if line because it's missing one on the end ). If possible, I would recommend speaking to whoever may have edited this originally and get with them for assistance, but outside of that, you could try adding:
+^NQfield_name='+gs.getUserID();
at the end, in place of the current semi-colon after getPersonnelNumber. You'd need to replace field_name with the appropriate field on the record of course.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!