[rt-users] absence planning

Alex Peters alex at peters.net
Thu Jul 24 09:33:02 EDT 2014


You can probably use:

$self->TicketObj->OwnerObj->FirstCustomFieldValue('absent')

to access the value of the owner's "absent" custom field.

I don't understand why you are testing for a ticket status change.
 Wouldn't you want the scrip to run only when correspondence occurs?


On 24 July 2014 23:14, Eierschmalz, Bernhard <
Bernhard.Eierschmalz at scheppach.com> wrote:

>  Hello,
>
>
>
> I want to build some absence planning into our RT to avoid that absent
> users receive messages and nobody sees this message. What I’m planning is
> the following:
>
>
>
> 1.      Creating a user’s custom field “absent” which is yes or no
>
> 2.      When a user is absence, this user changes this field to yes, when
> he’s back he changes back to no
>
> 3.      When the status of one ticket with absent owner (where custom
> field value is “yes”) changes, the owner show be set to nobody (so the
> other colleagues can find the ticket
>
>
>
>
>
> so I planned to set up this with a Scrip.
>
> Scrip Action is easy. It’s
>
> *$self->TicketObj->SetOwner ( $RT::Nobody->id );*
>
> *Return 1;*
>
>
>
>
>
>
>
> What I’m having problems with is Scrip Condition.
>
>
>
> For the first step, I tried to run the scrip on any update, so I only have
> to check whether the absent-CF is yes or no
>
> I tried the following line:
>
> *return 1 if
> $self->TicketObj->Owner->Customfields->CustomFieldValue(‘absent’) eq “yes”;*
>
>
>
> but this isn’t working. What is wrong?
>
>
>
>
>
> A second step will be to check, what exactly was changed (and only run if
> status was changed).
>
> I think I can do this with
>
> *return 0 unless $self->TransactionObj->Type eq “Status” *
>
>
>
> in front of the other code; am I right?
>
>
>
>
>
>
>
> Best regards,
>
>
>
> Bernhard,
>
> --
> RT Training - Boston, September 9-10
> http://bestpractical.com/training
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140724/ab354560/attachment.htm>


More information about the rt-users mailing list