[Rt-devel] Setting priority on create based on CF value Scrip

Dániel Omaisz-Takács otdmunka at gmail.com
Fri Apr 24 09:55:01 EDT 2009


Found the solution, i did it all wrong :)

The working code is: / line start with # are comments DO NOT paste them :)

#Get CF value
my $cf_va = $self->TicketObj->FirstCustomFieldValue('Priority');

#Set Priority number based on the text value set by the end user
my $pri_va = "";
$pri_va = "85" if ($cf_va =~ /^C/);   #Critical
$pri_va = "71" if ($cf_va =~ /^V/);   #Very High
$pri_va = "41"  if ($cf_va =~ /^H/);  #High
$pri_va = "21"  if ($cf_va =~ /^M/); #Medium
$pri_va = "0" if ($cf_va =~ /^L/);     #Low

#end set the priority!
$self->TicketObj->SetPriority($pri_va);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/rt-devel/attachments/20090424/c9d31b7b/attachment.htm 


More information about the Rt-devel mailing list