1 Reply Latest reply on Jun 30, 2009 6:42 AM by Stu McNeill

    Query Creation for New Attribute

    Apprentice

      Hello Everyone,

       

      Was wondering if I could request some assistance. I recently created a Boolean Attribute for True/False value called "Severity Downgraded". The idea behind the creation of the object is that when we downgrade a severity 1 ticket (normally due to issue resolution but investigations continuing as to full root cause) the queries that look for a severity 1 incident that are run daily do not pick up these tickets. The idea was that I created the attribute and when we downgrade a Severity 1 ticket we set the attribute to True and then the query could be adapted slightly to include any that have that attribute as well as severity 1's within the Date Period chosen.

       

      I have come across a slight snag with this in the way the criteria seem to run, the way they are currently setup is:

       

      AND     Severity is Equal to ( 1 - Severe Business Impact )

      OR       Severity Downgraded is Equal to ( True )

      AND     Creation Date Is Between (Prompt User For Value)

       

      When running this it brings up seemingly every Severity 1 before the creation of the Attribute (and after) even though they have not got the attribute on the window set to True and ignoring the Date Criteria.

       

      If I move the severity downgraded criteria down a level so it's on the bottom, it brings up all the severity 1 ticket's created in that time period and ANY ticket that has had that attribute set to True regardless of date which makes sense. If I move the severity downgraded criteria up a level to the top, I get no results whatsoever.

       

      I am not entirely sure where I am going wrong on this query so any assistance that could be offered would be appreciated.

       

      Many Thanks,

       

      Anthony Mitchell

      The AA

        • 1. Re: Query Creation for New Attribute
          Stu McNeill Employee

          Hi Anthony,

           

          You're not going mad, you've simply fallen foul of the class Query Designer oddity that comes with using OR criteria.  The problem here is that the OR criteria has forced the AND conditions around it to be grouped which is why your current query is returning Serveity 1 incidents regardless of the creation date.

           

          Normally the way to fix this is to duplicate the AND condtion which in your case would be the Creation Date:

           

                      Severity is Equal to ( 1 - Severe Business Impact )

          AND     Creation Date Is Between (Prompt User For Value)

          OR       Severity Downgraded is Equal to ( True )

          AND     Creation Date Is Between (Prompt User For Value)

           

          Unfortuantely this will mean you have to enter the prompt date value in twice (once for each group of AND conditions) which I appreicate will be a pain.  In most cases the condition that needs duplicating isn't a prompted one, when it is though there is no way around having to have it prompt twice I'm afraid.

           

          The good news is this is fixed in 7.3 (due July 31st) with the introduction of advanced criteria formula!