1 Reply Latest reply on Nov 29, 2016 6:47 AM by Ricardo_Almeida

    First analyst assingmened (Time) - Report/Query

    Specialist

      Hi Community,

       

      I have been requested by business to set up a report or a query were we can take the following information:

       

      When a ticket is created it "lands" 1st to a support group. After that is when the ticket can be assigned to an analyst.

       

      We are looking for a way to have the information of when a ticket is 1st assigned to an analyst, basically the time it takes from the first assignment (Support Group assingment) to the assignment of an analyst.

       

      Is anybody aware of the attributes i can use to do this? Can this be done on a global level (through process) or a query will need to be created for all modules individually?

       

      Any questions please let me know.

       

      Best Regards,

       

      Ricardo Almeida

        • 1. Re: First analyst assingmened (Time) - Report/Query
          Specialist

          The following calculation was made on a new attribute "Firstassignedanalyst" in order to calculate the time it takes for an incident to be 1st assigned to a analyst (not to a support group) within support hours.

           

          import System

          static def GetAttributeValue(Incident):

            AssignmentTime = DateTime.UtcNow

            if Incident.Assignments.Count > 0:

            SortedAssignments = List(Incident.Assignments as Collections.IEnumerable)

            SortedAssignments.Sort() do (first,last):

            last.CreationDate.CompareTo(first.CreationDate)

            FirstUserAssign = null

            for assigns in SortedAssignments:

            if assigns.User != null and FirstUserAssign == null:

            FirstUserAssign = assigns

            AssignmentTime = FirstUserAssign.CreationDate

            TimePeriod = Incident.GetBusinessTime(Incident.CreationDate, AssignmentTime)

            return String.Format("{0} Day(s), {1} Hour(s), {2} Minute(s), {3} Second(s)", Math.Floor(TimePeriod.TotalDays),TimePeriod.Hours, TimePeriod.Minutes, TimePeriod.Seconds)

           

          Best Regards,

           

          Ricardo Almeida