InitialPriorityOnSelfService: Difference between revisions

From Request Tracker Wiki
Jump to navigation Jump to search
m (2 revisions imported)
 
(No difference)

Latest revision as of 15:11, 6 April 2016

Allow SelfService-users to set the initial priority of a ticket

The following combination of a custom field and scrip allows users of the SelfService interface to defined an initial priority for a ticket (which gets copied into the ticket's priority on creation).

Custom Field

Custom Scrip

  • In "Configuration -> Global -> Scrips" create new Scrip "On Create Copy Initial Priority to Priority"

Custom condition

return 0 unless 'Create' eq $self->TransactionObj->Type;

my $CFName = 'Initial Priority';
my $InitialPriority = $self->TicketObj->FirstCustomFieldValue( $CFName );

return ($InitialPriority =~ /^(\d|[1-9]\d|100)$/) ? 1 : 0;

Custom action preparation code

return 1;

Custom action cleanup code

my $CFName = 'Initial Priority';
my $InitialPriority = $self->TicketObj->FirstCustomFieldValue( $CFName );
$self->TicketObj->SetPriority($InitialPriority);

return 1;

Thank You

Tig| and ruz on #rt at irc.perl.org