Issue with Query Business Rule

valentin3
Tera Guru

Hello guys,

I have a problem here. 

I created a Query Business rule on task table that is running only for users from group X. The condition that I build is:

- assignment group to be group X

OR

- business service to be Y 
OR
- opened_by - user from the group X 

In list view is working fine, it display what it should display. 

The issue is when I try to open any record from that list (in this case incidents), it shows me other record from that list, but not the one that I clicked. It is the same for each record...I don't know where the issue is..

Could you help me?

1 ACCEPTED SOLUTION

You will have to replace it with .addOrCondition().

You can chain multiple together.

Like this:


current.addQuery('your_field', your_value)
.addOrCondition('some_other_field', some_other_value)
.addOrCondition('another_field', another_value);

 

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@valentin3 

did you check any table specific query BR is running?

why not handle it at specific table level such as incident, problem, change rather than task?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hello @Ankur Bawiskar ,

I created QBR for specific tables initially, like you suggested "incident", "ritm", "Req"...etc, but it creates extra business rules in the instance. 
So, I moved the logic in task table where I can see all of these tables. In the list view, the users sees the records correctly, but when I open the record I see other record.  

It seems that the error is caused by this KB0564887. 

Can you advice?

@valentin3 

are you using that operator?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes, I was using it. 

Can you suggest how should I change the code to not include "^NQ", but still use the "OR" condition?