Restrict setting status to "resolved"

Despite all my work with the REST interface, I know little to nothing about
scrips. I’ve been asked to restrict setting ticket status to ‘resolved’
unless the actor is a requestor.

I tried setting up a scrip with condition On resolve, Action User defined,
Stage Transaction Create:

return 1 if $self->TransactionObj->IsInbound;
$TicketObj->_Set(Field => ‘Status’, Value => ‘open’, RecordTransaction => 0);
return 0;

and also:

return 1 if $self->TransactionObj->IsInbound;
$TicketObj->_Set(Field => ‘Status’, Value => ‘open’, RecordTransaction => 0);
return 1;

and tried this in both custom action prep code and custom action cleanup
code, as I’m not terribly clear on where it belongs. (I probably also want
the Value to be the ‘old value’, but I’m not sure how to access that).

However, nothing seems to have any effect on a user being able to set a
ticket status to resolved when they are not a requestor. Any scrip fu
guru’s out there willing to beat me with a clue bat?

– ============================
Tom Lahti
BIT Statement LLC

(425)251-0833 x 117
http://www.bitstatement.net/
– ============================

Argh, as usual the answer hits me right as I hit ‘send’.

$TicketObj->_Set(Field => ‘Status’, Value => ‘open’, RecordTransaction => 0);

should be

$self->TicketObj->blah blah…

Now, how to get at the “old value” instead of hard-coding “open”.

– ============================
Tom Lahti
BIT Statement LLC

(425)251-0833 x 117
http://www.bitstatement.net/
– ============================

Now, how to get at the “old value” instead of hard-coding “open”.

$self->TransactionObj->OldValue

Shawn