Custom Field (Priority) not Updating Actual Priority

I have setup a Custom Field for users to enter a Priority
(Minor/Low/Medium/High/Critical). When a ticket is created, this custom
field updates the actual Priority via a custom scrip.

Condition: On Transaction
Action: User Defined
Stage: TransactionCreate
Snippet:
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 = “4” if ($cf_va =~ /^Critical/ or $cf_va == “4”);
$pri_va = “3” if ($cf_va =~ /^High/ or $cf_va == “3”);
$pri_va = “2” if ($cf_va =~ /^Medium/ or $cf_va == “2”);
$pri_va = “1” if ($cf_va =~ /^Low/ or $cf_va == “1”);
$pri_va = “0” if ($cf_va =~ /^Minor/);

#Set the priority
if($pri_va != “”){$self->TicketObj->SetPriority($pri_va)};

This works fine, but if someone goes into the ticket Basics and changes the
Priority via the CF, it does not update the actual Priority? It will update
if they send out an email, etc. Curious what I am missing here? New to RT
and it’s super powerful but baffling. :slight_smile: Thanks for any leads!

View this message in context: http://requesttracker.8502.n7.nabble.com/Custom-Field-Priority-not-Updating-Actual-Priority-tp54815.html

I have setup a Custom Field for users to enter a Priority
(Minor/Low/Medium/High/Critical). When a ticket is created, this custom
field updates the actual Priority via a custom scrip.

You may just want to use

-kevin

Thanks for the suggestion, Kevin. I am using Priority as a mandatory Custom
Field when tickets are created. Is there another way to make selecting a
Priority mandatory at ticket creation? If I used PriorityAsString Extension,
wouldn’t I still have this problem - only they are strings instead?
Appreciate the help, still super new to all of this…

View this message in context: http://requesttracker.8502.n7.nabble.com/Custom-Field-Priority-not-Updating-Actual-Priority-tp54815p54820.html

Thanks for the suggestion, Kevin. I am using Priority as a mandatory Custom
Field when tickets are created. Is there another way to make selecting a
Priority mandatory at ticket creation? If I used PriorityAsString Extension,
wouldn’t I still have this problem - only they are strings instead?
Appreciate the help, still super new to all of this…

Ah - you didn’t say ‘mandatory’ in your original email, you just
showed code for converting from strings to integers.

When you say it doesn’t work on the basics page, if you navigate away
from Basics to the History, do you see that it ran?

You should also keep in mind that you can always write
RT->Logger->error($pri_va);
in your Scrip to debug what’s going on.

-kevin