Useful contributions

Hello. All.
I want to introduce several scrips, actions, scripts that could be
useful.

  1. Template part that add Attachment links list to email.
    { my $res;
    my $Attachments = $Transaction->Attachments;
    while (my $a = $Attachments->Next) {
    next unless ($a->Filename);
    $res .= “Attachments:\n” unless ($res);
    $res .= " “. $RT::WebURL .”/Ticket/Attachment/". $Transaction->Id()
    ."/". $a->id ."/". $a->Filename;
    }
    $res;
    }

  2. Scrip that on ticket resolving open all tickets which depends on
    resolved.
    Description: open tickets which depends on resolved
    Condition: On Resolve
    Custom Condition:
    Action: User defined
    Custom action preparation code: return 1;
    Custom action cleanup code:
    my $DepOnBy = $self->TicketObj->DependedOnBy;
    while (my $l = $DepOnBy->Next) {
    if ($l->BaseIsLocal and $l->BaseObj->Status ne ‘open’) {
    $l->BaseObj->SetStatus(‘open’);
    }
    }
    $DepOnBy = undef;
    return 1;
    Template: Global template: Blank

  3. Scrip that on ticket resolving open all tickets which has resolved
    ticket as member only if all their members are resolved.
    Description: open tickets which has link on resolved ticket as member if
    all members resoved
    Condition: On Resolve
    Custom Condition:
    Action: User defined
    Custom action preparation code: return 1;
    Custom action cleanup code:
    my $MemberOf = $self->TicketObj->MemberOf;
    while (my $l = $MemberOf->Next) {
    if ($l->TargetURI->IsLocal and
    $l->TargetObj->Status ne ‘open’) {
    my $ms = $l->TargetObj->Members();
    while (my $m = $ms->Next()) {return 1 if $m->Status =~
    /^(?:new|open|stalled)$/;}
    $l->TargetObj->SetStatus(‘open’);
    }
    }
    return 1;
    Template: Global template: Blank

  4. Last, attached perl script that marks Tickets from command line
    defined requestor as deleted.
    WARNING: Don’t use this script unless you are really know what you are
    doing. I’m not responsible for any damage that could be done by this script.

delete-by-requestor (1005 Bytes)