code: def get_prev_status_from_history(instance, status=None):
      
      target = status or api.get_workflow_status_of(instance)
      history = getReviewHistory(instance, reverse=True)
      history = map(lambda event: event["review_state"], history)
      if target not in history or history.index(target) == len(history)-1:
          return None
      return history[history.index(target)+1]
docs: Returns the previous status of the object. If status is set, returns the
      previous status before the object reached the status passed in.
      If instance has reached the status passed in more than once, only the last
      one is considered.