How the 'OR' functions in a Service Desk Query

Version 2

    This document has been created to cover how the 'OR' statement works in a LANDesk Service Desk query.

     

    In this example we had two criteria that needed to be met.

     

    1) We needed to see all of the open incidents that are assigned to the current users group. The current assignment may or may not have the assignment to a group. Because of this we added the Current Assignment.User.Current Group is Current Group to the query.

     

    2) Sometimes an assignment would be assigned to the group and not to a specific user. Because of this, the above statement would not return all of the open incidents for that group. We then added the Current Assignment.Group is Current Group to the query.

     

    Now that we have the two statements that need to be returned we can create the query.

     

    If you create a query based on just the above statement you would not get many results.

     

    This is what that would look like in the Criteria section of the Query Designer:

     

    AND Status.Name is One of ( open, acknowledged )

    AND Current Assignment.User.Current Group is Current Group

    AND Current Assignment.Group is Current group

     

    In order for that statement to return results the current assignment would have to have a current user assigned to it as well as the same group that the user is a member of.

     

    So then an 'OR' statement is needed. We need to say if the case is open or acknowledge and the current assignment user group is the current group or the Current Assignment group is the current group.

     

    The statement would then look like this in the Query Designer:

     

    AND Status.Name is One of ( open, acknowledged )

    AND Current Assignment.User.Current Group is Current Group

    OR Current Assignment.Group is Current group

     

    When that is run it will return all of the open incidents for the current assignment Users current group and all of the cases (whether open or closed) where the current assignment is the users group.

     

    In order for this to work correctly, you will have to recreate all of the needed statements for the 'OR' statement.

     

    For this example to work it would need to be put in like this:

     

    AND Status.Name is One of ( open, acknowledged )

    AND Current Assignment.User.Current Group is Current Group

    OR Current Assignment.Group is Current group

    AND Status.Name is One of ( open, acknowledged )

     

    The 'OR' statement will group everything above it as one group and everything below it as another group.