How to evaluate Categories in calculations.

Version 3

    Evaluating Categories in Calculations

     

    If you want to evaluate a category in your calculation, you need to consider whether you want to evaluate a specific category, or a category and all its subcategories as well.

     

    For example,

    if Incident.Category != null and Incident.Category.FullName == 'Hardware':

    Evaluates the category “Hardware” only.

     

    Alternatively,

    if Incident.Category != null and Incident.Category.FullName.StartsWith (“Hardware”):

    Evaluates the category “Hardware” and all categories beneath it. 

     

    This is because it uses the “StartsWith()” function.  For an explanation of how this and other string functions work, please see Calculation Writing Tutorial - 6.  Working with Strings.