Commit ec305bba authored by Kevin Falcone's avatar Kevin Falcone
Browse files

Refactor to store the ticket type

A ticket in the Incidents queue is of type Incident, so there is that
small change in the incident if.  TicketType can also return undef so we have to

We use the ticket type to skip doing other replacements.
parent b85f1687
......@@ -192,11 +192,15 @@ my $handle = ${$ARGS{handle}};
${$ARGS{handle}} = sub {
my %args = @_;
$args{incident} = $args{ticket}->id
if $args{ticket} and $args{ticket}->QueueObj->Name eq 'Incidents';
if ( $args{ticket} ) {
$args{type} = RT::IR::TicketType( Queue => $args{ticket}->QueueObj->Name );
$args{lookup_params} = "ticket=".$args{ticket}->id
if $args{ticket} && !$args{lookup_params};
$args{incident} = $args{ticket}->id
if $args{type} && $args{type} eq 'Incident';
$args{lookup_params} = "ticket=".$args{ticket}->id
if !$args{lookup_params};
$args{lookup_params} .= "&"
if $args{lookup_params} and $args{lookup_params} !~ /&$/;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment