Problem / Solution: OR Criteria in Query isn't showing the correct result.

Version 5

    Verified Product Versions

    Service Desk 7.7.xService Desk 7.8.xService Desk 2016.xAsset Manager 2016.xAsset Manager 2017.xService Desk 2017.x


    I have created a Query with the following Criteria, I'm expecting to see all Open Incidents that has an Open Assignment which is either assigned to my current Group or to me directly. But I'm not getting the expected results.


    The results I'm seeing is all Open Incidents with an Open Assignment that is assigned to me -- OR-- Every single Incident's Assignment that is assigned to my Current Group.





    The reason is that the Criteria will be read from the top and when it hits the OR Criteria it will "Start again" not taking in to account the previous Criteria.

    So the above Criteria will be read like this:


    Show me everything where Incident status is not End, is not Complete. Status is Open and User is current User... OR Show me everything where Group is Current Group

    For every OR Criteria you add in your Query you will need to also add in all the Criteria that you would like to see with this OR Criteria.

    For example, the Criteria in the Query above will need to be written like this:

    correct criteria.JPG



         Using Advanced Criteria:


    If you are on a later version of Service Desk, you will be able to used Advanced Criteria instead of having to add the Criteria twice.

    You access the Advanced criteria by clicking the "Advanced" button down in the right corder on the Criteria page.


    advanced button.jpg


    With Advanced Criteria you can do a lot more than with normal Criteria. For example in this scenario you can group the added Criteria and also use one single Criteria more than once, hence why you only need to add on the Criteria once.


    So instead now we can remove all the duplicate criteria, which will make it look like this:



    We then activate the Advanced Criteria. For the Advanced Criteria you always use the Index number to specify which Criteria you are referring to.

    You then use ( and ) to group the Query and type in the Relationship in between. So our finished Advanced Criteria will look like this:


    advanced criteria.jpg


    Please note that Advanced Criteria will take priority above the normal Criteria so you will not need to worry about changing the relationship in the normal Criteria section.