[Rtir] Blocks

Gorazd Bozic gorazd.bozic at arnes.si
Wed Mar 31 06:16:30 EST 2004


Przemek Jaroszewski wrote:

> Hi,
> 
> Can anyone explain how do "blocks" work in RTIR? I listed proper people as
> watchers of the 'Blocks' queue so they can receive all correspondence, but
> I have no idea what triggers state changes of tickets in that queue (eg.
> active->removed?). Also, should those people be able to login to RTIR or
> is it up to me? If so, should they be members of any group in particular?

I guess you can create a separate group that can access only tickets in
Blocks queue and then add users to that group.

Since our NOC people would probably pour sugar in my car's tank if I
suggested to them that they have to learn a new tool and process all the
blocks via RTIR, I decided that I'll add custom scrips that would
process mail messages in Blocks queue and look for agreed predefined
strings. If certain strings are present, the block changes state.

So far I have implemented only one (to us crucial) transition: from
"pending activation" to "active", the rest is still done manually. I
have added the following scrip to queue Blocks:

Description: Activate Block

Condition: On Correspond

Custom condition: 	

Action: User Defined

Custom action preparation code: 1

Custom action cleanup code:

# ------------------------------------------------------------------- #
my $State;
my $cf = RT::CustomField->new($self->TransactionObj->CurrentUser);
$cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id,
                        Name => '_RTIR_State');
unless ($cf->Id) {
    return(1);
}

@content = @{$self->TransactionObj->MIMEObj->body};
if ( (scalar(grep(/^[^>]*\*OK\*/, @content)) > 0) &&
     ($cf->Name eq 'pending activation') ) {
  $State = 'active';
} else {
  return 0;
}
$self->TicketObj->AddCustomFieldValue(Field => $cf->id,
                                      Value => $State);
return 1;
# ------------------------------------------------------------------- #

Stage: TransactionCreate

Template: Global template: Blank

In brief: if the NOC replies to the block request with a message that
contains "*OK*" at the beginning of the line, the state of the block is
changed. This can easily be modified to parse for other responses and
change states as appropriate.

HTH,
Gorazd

-- 
Gorazd Bozic <gorazd.bozic at arnes.si>
ARNES SI-CERT, Jamova 39 p.p. 7, SI-1001 Ljubljana, Slovenia
tel: +386 1 479 88 22, fax: +386 1 479 88 99



More information about the Rtir mailing list