Current Assigned Analyst / Group is showing wrong value when having two or more Assignments in one transition

Version 2

    Verified Product Versions

    LANDESK Service Desk 7.6LANDESK Service Desk 7.7.x

    Environment:

    Service Desk - 7.3 and up.

     

    Problem:

     

    I'm using the "Current Assigned Analyst" and "Current Assigned Group" on my main window, but if I have two automatic "Add Assignment" after each other in the Process in the same transition I will see the value of the first assignment and not the last.

     

    Cause:

     

    When using the default calculation added to the "Current Assigned Analyst" and "Current Assigned Group", the calculation will go by the Creation date/time of the Assignment. Any actions that are being performed in the same transition (from one status to another) will all have the same creation date/time and so if you have two assignment in the same transition they will both have been created at the same time.

    Therefore the calculation won't know which assignment to look at and will show you the value of the first one.

     

    In the below example, if you tick the "Resolve on Creation" tick box when logging the Incident your Incident will go through two assigment before landing on the Resolved Status.

     

    process.png

     

    Solution:

     

    If possible the quickest might be to redesign your process to make sure that you are only ever being able to go through one assignment per transition. If this isn't possible then you can instead change your Before Save Calculation to look at the Assignment's Serial Number rather than the creation date.

     

    Here is the Calculation to use for the Assigned User:

    Note to keep your Dependancy to "Assignments"

     

    import System
    static def GetAttributeValue(Incident):
         Value = ' '
         Assignment = Incident.Assignments.Max("SerialNumber")
         if Assignment.User != null: Value = Assignment.User.Title
         return Value
    

     

    calculation.png

     

     

    Here is the Calculation to use for the Assigned Group:

    Note to keep your Dependancy to "Assignments"

     

    import System
    static def GetAttributeValue(Incident):
         Value = ' '
         Assignment = Incident.Assignments.Max("SerialNumber")
         if Assignment.Group != null: Value = Assignment.Group.Title
         return Value
    

     

     

    calculation_group.png