[rt-users] Getting a custom field value and setting the priority
Kevin Falcone
falcone at bestpractical.com
Thu Sep 23 11:24:07 EDT 2010
On Thu, Sep 23, 2010 at 11:15:22AM -0400, Bass, Janet E. wrote:
> I have a custom field called priority
> It has 3 possible values
> 1 Unable to work
> 2 Work is impaired
> 3 Info/Low priority
Have you considered RT-Extension-PriorityAsString ?
-kevin
> What I want to do with a scrip is read the value of the custom field
> Priority = Unable to work
> $Value = Unable to work
> Loop through to set the correct value with an if statement
> Then assign that numeric value to the system variable priority
>
> I have tried but nothing set the field I see under The Basic ->priority to
> the value I want
> $self->TicketObj->$SetPriority = $Priority;
> $self->TicketObj->$Priority = $Priority;
> $self->TicketObj->$SetInitialPriority = $Priority;
>
>
> Scrip code (under Custom action cleanup code) I have return 1; under Custom
> action preparation code
>
> my $CFName = 'Priority';
> my $Value = $self->TicketObj->FirstCustomFieldValue( $CFName );
> my $Priority = 3;
> if ($Value =~ /Unable/i)
> {
> $Priority = 1;
> }
> elsif ($Value =~ /impaired/i)
> {
> $Priority = 2;
> }
> else
> {
> $Priority = 3;
> }
>
> $self->TicketObj->$SetPriority = $Priority;
>
> return 1
>
> Thanks for any help
> Janet Bass
>
>
> RT Training in Washington DC, USA on Oct 25 & 26 2010
> Last one this year -- Learn how to get the most out of RT!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100923/fc46cf73/attachment.sig>
More information about the rt-users
mailing list