3 Replies Latest reply on Oct 9, 2013 8:18 AM by Jamie Cannon

    Checking to see if a Task is Rejected

    Jamie Cannon ITSMMVPGroup

      I have a set up consistant of a decision checking to see if a task as been reject.  If yes, got to X status if no go to Y.

       

      If one has the user has to update the form and resubmit at which point goes back through the task review and approval.  If all are approved this time my condition is still invalid because there still is a task in the DB for this ticket shown as rejected.  Is there a way around this? 

        • 1. Re: Checking to see if a Task is Rejected
          dmshimself ITSMMVPGroup

          Just thinking out loud here.  If the resubmit used a windowless action to set a date field'date of last resubmit'.  Then modify the condition to make sure that not only is the (latest/all) task rejected, but also the date of task completion is greater than the date of last resubmit.

          • 2. Re: Checking to see if a Task is Rejected
            Jamie Cannon ITSMMVPGroup

            interesting.  so after the resubmit action have a date field on the main Change form for date of last submit then write the calculation on the condition to read that date and verify what has happened after that date?  I'm assuming this would require a calculation?

            • 3. Re: Checking to see if a Task is Rejected
              Jamie Cannon ITSMMVPGroup

              Here is what I have. I want to loop through the Tasks to find the statuses then if the Status = Rejected and the lastest date is > the date I passed automatically I need a true returned. However, in testing I get this error:
              "Field 'Touchpaper.Framework.Data.DataObjectListProxy.Status' not found."

               

              import System

              static def GetAttributeValue(Change):

                  IsRejected = false

                  DateOfLastResubmit = Change._DateofLastResubmit

                 

                  for Status in Change.Tasks.Status:

                      if Status.Title == "Request Rejected" and Change.Tasks.Latest().CreationDate > DateOfLastResubmit:

                          IsRejected = true

                  return IsRejected