2 Replies Latest reply on Jul 16, 2015 3:33 AM by Mariusz.Maniak

    time after breach for closed incidents

    Mariusz.Maniak Expert

      Hi all!


      Is it possible to calculate time after breach for closed incidents using GetBuissnesTime?


      My calculation is:


      import System

      static def GetAttributeValue(Incident):


              Value = 0

              if Incident.BreachTime!=null:

                  if Incident.IsBreached== true:

                      if Incident.Resolutions.Count!= 0:

                          Rozw= Incident.Resolutions.Latest().CreationDate

                          Czas= Incident.GetBusinessTime(Rozw,Incident.BreachTime)

                          Value = Math.Floor(Czas.TotalHours)


                          Value = 333333


                      Value = 222222


                  Value = 111111

              return Value

          except e:

              raise String.Format('Error on {0}: {1}', e.StackTrace.Substring(e.StackTrace.LastIndexOf(':') + 1), e.Message)


      When I'm trying to test this calculation - error appears:

      error on line 9: function not available on client



      If line:

      Czas= Incident.GetBusinessTime(Rozw,Incident.BreachTime)

      is replaced by:


      Czas= Rozw - Incident.BreachTime


      calculation works fine.

      It means that GetBusinessTime works only in not closed incidens?


      (values 111111, 222222, 333333 are set for debugging purposes, to check which "if" fails)