In our system our category list has 3 tiers. For example 'Application A to B, Access 2003, Unable to load'. What I'm wanting to do is group the query based on the middle tier (Access 2003) but all I can group the query on is either Category.Full Name which brings up all 3 tiers in the category or Category.Title which brings up the last tier (Unable to load).
Is there anyway I can group the query based on the middle tier, for example Access 2003?
You can do this if you add a calculated field to the category object.
Call it "Parent Category" and add it to the category window.
Your calculation will be:
import System static def GetAttributeValue(Category): Value = Category.Parent.Title return Value
static def GetAttributeValue(Category):
Value = Category.Parent.Title
Set Calculation Type to scheduled and create a bulk action in schedule manager to update existing categories.
When done change the calculation type to "After Read" to update any new categories you add. The category window must have your new field and the Parent attribute showing and the calculation handler (OnValueChanged) for this needs to be added.
Your group query can then be created using your new "Parent Category" to group your results.
You shouldn't need a new attribute to hold this, you should be able to just get to Category.Parent in the query design.
However either way will only work if all your incidents have the category set at the 3rd level. Otherwise the parent might be the top level or even blank.