[rt-users] absence planning

Alex Peters alex at peters.net
Thu Jul 24 10:11:20 EDT 2014


There might be API inconsistency across RT versions.  What version of RT
are you using?  Also, are you receiving any errors in RT's logs when that
code runs?

If I understand you correctly, the "on correspond, open inactive tickets"
scrip is interfering with your ability to test whether an absent owner's
ticket was previously marked as stalled or resolved rather than open.  If
you move your scrip to execute before the scrip that opens inactive tickets
on correspond, the interference should no longer occur.


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

>  So now I try:
>
> *return 1 if $self->TicketObj->FirstCustomFieldValue('absent') eq "yes";*
>
>
>
> But it still doesn’t work. What is wrong?
>
>
>
> 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?
>
> A user usually changes all his tickets to “stalled” or “resolved” when
> he’s absent. When the user leaves tickets on “open” during his absence that
> means, nobody else can finish this ticket, only he can do it (e.g. on
> larger projects)
>
> So when one of the stalled or resolved tickets receive an answer, the
> status is changed and with my scrip the user will be nobody.
>
>
>
>
>
> Best regards,
>
>
>
> Bernhard
>
>
>
> *Von:* Alex Peters [mailto:alex at peters.net]
> *Gesendet:* Donnerstag, 24. Juli 2014 15:33
> *An:* Eierschmalz, Bernhard
> *Cc:* rt-users at lists.bestpractical.com
> *Betreff:* Re: [rt-users] absence planning
>
>
>
> 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/20140725/54b0ffde/attachment.htm>


More information about the rt-users mailing list