대상 상태로 태스크 추적

일부 조건부 논리를 적용하기 위해, 현재 조치를 수행 중인 레코드의 대상 상태를 판별할 수 있습니다. 다음은 몇 가지 예제입니다.

다음 조치 알림 후크는 대상 상태를 가져와서 현재 레코드가 닫힌 경우 이메일을 보냅니다.

주: 이 조치 알림 후크를 기본 조치를 사용합니다. 기본 조치는 모든 조치와 함께 발생하는 조치입니다. 모든 조치와 함께 발생하는 이메일 알림 후크 등과 같이, 후크가 둘 이상의 조치와 함께 발생하도록 할 때 이 기본 조치가 편리합니다.

VBScript

Sub Defect_Notification(actionname, actiontype)

   Dim cqSes ' a Session object

   Dim entDef ' an EntityDef object

   Dim actionname ' a String

   Dim actiontype ' a Long

   ' action = test_base

   set cqSes = GetSession
   ' NOTE: You can also have conditional logic based on the
   ' current action

    set entDef = cqSes.GetEntityDef(GetEntityDefName)

    if entDef.GetActionDestStateName(actionName) = "Closed" then

       ' put send notification message code here

    end if

End Sub 

Perl

sub Defect_Notification {

    my($actionName, $actiontype) = @_;  

    # $actionName as string scalar

    # $actiontype as long scalar

    # action is test_base

   $actionName = $entity->GetActionName();
    # NOTE: You can also have conditional logic based on the
    # current action

  # You can use the $session variable that Rational ClearQuest provides. 

    $entDef = session->GetEntityDef($entitiy->GetEntityDefName());

    if ($entDef->GetActionDestStateName($actionName) eq "Closed") 
      {# put send notification message code here}

} 

피드백