<div dir="ltr">Since you only want to run this scrip when correspondence occurs on a stalled/resolved ticket, and the owner is absent, the following condition should work:<div><br></div><div><font face="courier new, monospace"># is this correspondence?</font></div>
<div><font face="courier new, monospace">return if $self->TransactionObj->Type ne 'Correspond';</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"># is the ticket stalled/resolved?</font></div>
<div><font face="courier new, monospace">my $status = $self->TicketObj->Status;</font></div><div><font face="courier new, monospace">return if $status ne 'stalled' and $status ne 'resolved';</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"># is the owner absent?</font></div><div><font face="courier new, monospace">my $absent = $self->TicketObj->OwnerObj->FirstCustomFieldValue(27);</font></div>
<div><font face="courier new, monospace">return if not defined $absent or $absent eq 'No';</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"># all criteria apply</font></div>
<div><font face="courier new, monospace">return 1;</font></div><div><br></div><div>Go to Admin > Global > Scrips as a super user and use the Up/Down controls to ensure that your custom scrip runs before the On Correspond Open Tickets scrip.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 31 July 2014 21:56, Eierschmalz, Bernhard <span dir="ltr"><<a href="mailto:Bernhard.Eierschmalz@scheppach.com" target="_blank">Bernhard.Eierschmalz@scheppach.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="DE" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Hi Alex,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Yes, it works now! Great!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Now the second step – to check the state.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">I think it should be OK when I change my condition to:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">return 0 if $self->Status eq 'open';<u></u><u></u></span></i></p>
<div class="">
<p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">my $CFval = $self->TicketObj->OwnerObj->FirstCustomFieldValue(27);<u></u><u></u></span></i></p>
</div><p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">return 1 if defined $CFval and $CFval eq 'yes';<u></u><u></u></span></i></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">right?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">How do I manage to run this scrip before “on correspond open tickets” scrip?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Best Regards<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Bernhard<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Alex Peters [mailto:<a href="mailto:alex@peters.net" target="_blank">alex@peters.net</a>]
<br>
<b>Gesendet:</b> Donnerstag, 31. Juli 2014 13:26</span></p><div><div class="h5"><br>
<b>An:</b> Eierschmalz, Bernhard; <a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a><br>
<b>Betreff:</b> Re: AW: [rt-users] absence planning<u></u><u></u></div></div><p></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">I believe that the "Absent" custom field belongs to users rather than tickets. If that is correct, your code should read as follows:<br>
<br>
<span style="font-family:"Courier New"">my $CFval = $self->TicketObj->OwnerObj->FirstCustomFieldValue(27);<br>
return 1 if defined $CFval and $CFval eq 'Yes';</span><u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Note that values are case-sensitive, so a capital Y is required. Does this help?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">(P.S. Please reply-all to ensure that the list remains informed of this discussion.)<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On 31 July 2014 21:04, Eierschmalz, Bernhard <<a href="mailto:Bernhard.Eierschmalz@scheppach.com" target="_blank">Bernhard.Eierschmalz@scheppach.com</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Hallo Alex,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">If I understand correctly you mean when the Custom Field is not set, my $CFval will
be undefined?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">But the custom field for my testuser (who is owner of my test ticket) is set to ‘no’</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Could it be that the type of the custom field matters? I have selected “choose one value”.
My values are:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td width="159" valign="top" style="width:119.3pt;border:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Sort</span><u></u><u></u></p>
</td>
<td width="159" valign="top" style="width:119.3pt;border:solid windowtext 1.0pt;border-left:none;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Name</span><u></u><u></u></p>
</td>
<td width="159" valign="top" style="width:119.35pt;border:solid windowtext 1.0pt;border-left:none;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Description</span><u></u><u></u></p>
</td>
<td width="159" valign="top" style="width:119.35pt;border:solid windowtext 1.0pt;border-left:none;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Category</span><u></u><u></u></p>
</td>
</tr>
<tr>
<td width="159" valign="top" style="width:119.3pt;border:solid windowtext 1.0pt;border-top:none;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">0</span><u></u><u></u></p>
</td>
<td width="159" valign="top" style="width:119.3pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Yes</span><u></u><u></u></p>
</td>
<td width="159" valign="top" style="width:119.35pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Absent yes</span><u></u><u></u></p>
</td>
<td width="159" valign="top" style="width:119.35pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"><empty></span><u></u><u></u></p>
</td>
</tr>
<tr>
<td width="159" valign="top" style="width:119.3pt;border:solid windowtext 1.0pt;border-top:none;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">1</span><u></u><u></u></p>
</td>
<td width="159" valign="top" style="width:119.3pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">No</span><u></u><u></u></p>
</td>
<td width="159" valign="top" style="width:119.35pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Absent no</span><u></u><u></u></p>
</td>
<td width="159" valign="top" style="width:119.35pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"><empty></span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">It seems that either your custom field isn't named precisely "absent", or perhaps you are running an older version of RT which doesn't support loading custom
fields by name. If using the ID (27) works for you, it is probably best to just use that for now.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">It is named absent, and I user RT 4.2.6 – but I think anyway it’s better to use the
ID.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Best regards</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Bernhard</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Alex Peters [mailto:<a href="mailto:alex@peters.net" target="_blank">alex@peters.net</a>]
<br>
<b>Gesendet:</b> Donnerstag, 31. Juli 2014 12:28<br>
<b>An:</b> Eierschmalz, Bernhard; <a href="mailto:rt-users@lists.bestpractical.com" target="_blank">
rt-users@lists.bestpractical.com</a></span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><br>
<b>Betreff:</b> Re: AW: [rt-users] absence planning<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">The uninitialized value warnings can be solved by changing the test line:<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">my $CFval = $self->TicketObj->FirstCustomFieldValue(27);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">return 1 if defined $CFval and $CFval eq 'yes';<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">since when the custom field is not set, $CFval will be undefined.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">It seems that either your custom field isn't named precisely "absent", or perhaps you are running an older version of RT which doesn't support loading custom fields by name. If
using the ID (27) works for you, it is probably best to just use that for now.<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On 31 July 2014 19:50, Eierschmalz, Bernhard <<a href="mailto:Bernhard.Eierschmalz@scheppach.com" target="_blank">Bernhard.Eierschmalz@scheppach.com</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Hello Alex,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">your idea with 2 scrips running independent of each other sounds good – I will try this.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">But first, I still have the problem by loading the CF.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">I tried around a little bit – but no solution. I changed my Condition to the following:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">my $CFval = $self->TicketObj->FirstCustomFieldValue(27);</span></i><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">return 1 if $CFval eq 'yes';</span></i><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">I receive the following failure:</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">[12166] [Thu Jul 31 09:37:56 2014] [warning]: Use of uninitialized value $CFval in string eq at (eval 807) line 2. ((eval 807):2)</span></i><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">[12166] [Thu Jul 31 09:37:58 2014] [warning]: Use of uninitialized value $CFval in string eq at (eval 816) line 2. ((eval 816):2)</span></i><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">27 is the ID of my Custom field. When I change to
<i>FirstCustomFieldValue(‘absent’)</i> I receive the following failure message:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">[12166] [Thu Jul 31 09:49:00 2014] [warning]: Couldn't load custom field by 'absent' identifier (/opt/rt4/sbin/../lib/RT/Record.pm:2231)</span></i><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">[12166] [Thu Jul 31 09:49:00 2014] [warning]: Use of uninitialized value $CFval in string eq at (eval 829) line 2. ((eval 829):2)</span></i><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">[12166] [Thu Jul 31 09:49:06 2014] [warning]: Couldn't load custom field by 'absent' identifier (/opt/rt4/sbin/../lib/RT/Record.pm:2231)</span></i><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">[12166] [Thu Jul 31 09:49:06 2014] [warning]: Use of uninitialized value $CFval in string eq at (eval 838) line 2. ((eval 838):2)</span></i><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">What should I do now?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">best Regards,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Bernhard</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Alex Peters [mailto:<a href="mailto:alex@peters.net" target="_blank">alex@peters.net</a>]
<br>
<b>Gesendet:</b> Freitag, 25. Juli 2014 01:53</span><u></u><u></u></p>
<div>
<p class="MsoNormal"><br>
<b>An:</b> Eierschmalz, Bernhard<br>
<b>Cc:</b> <a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a><u></u><u></u></p>
</div>
<p class="MsoNormal"><b>Betreff:</b> Re: AW: [rt-users] absence planning<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p>I feel that you are overcomplicating your scrip by testing for a status change (which is actually a side effect of another scrip), because your primary goal is to perform this action when correspondence occurs.<u></u><u></u></p>
<p>If I were in your position, I would have two scrips in place:<u></u><u></u></p>
<p>1. On (correspond AND owner is absent AND ticket is stalled/resolved), set owner to Nobody. Runs first.<u></u><u></u></p>
<p>2. On correspond, open inactive tickets. Runs second.<u></u><u></u></p>
<p>Actually, in your position I would probably assign an additional "Exclusive" custom field to tickets that when set to true, indicates that the ticket can only be worked on by the current owner. Then I would change Scrip 1's condition to "on (correspond
AND owner absent AND ticket not exclusive)." That way, the status isn't used to convey that meaning.<u></u><u></u></p>
<p>Custom fields can be loaded by name, so that shouldn't be failing for you. Is "absent" the exact name of the field? What is the exact code that you are using?<u></u><u></u></p>
<div>
<p class="MsoNormal">On 25/07/2014 12:44 am, "Eierschmalz, Bernhard" <<a href="mailto:Bernhard.Eierschmalz@scheppach.com" target="_blank">Bernhard.Eierschmalz@scheppach.com</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Hello Alex,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">I user RT 4.2.6</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">In my error logs I find the following:
</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">[3066] [Thu Jul 24 14:16:20 2014] [warning]: Couldn't load custom field by 'absent' identifier (/opt/rt4/sbin/../lib/RT/Record.pm:2231)</span></i><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">[3066] [Thu Jul 24 14:16:20 2014] [warning]: Use of uninitialized value in string eq at (eval 896) line 1. ((eval 896):1)</span></i><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">[3066] [Thu Jul 24 14:16:23 2014] [warning]: Couldn't load custom field by 'absent' identifier (/opt/rt4/sbin/../lib/RT/Record.pm:2231)</span></i><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">[3066] [Thu Jul 24 14:16:23 2014] [warning]: Use of uninitialized value in string eq at (eval 905) line 1. ((eval 905):1)</span></i><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">What does this mean? Should I identify the CF by ID?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">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.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Not exactly. Let me explain once again.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">When a user is absent, he maybe has open tickets, and for sure has many resolved and
stalled tickets.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">The open tickets are tickets, only this user can resolve, and this user decides to resolve
this ticket after his absence. (e.g. because this is a large project)</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">When there is any transaction (e.g. an answer from client or somebody) the owner of
this ticket should not be changed (because the owner will resolve it after his absence)</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">on open tickets the “on correspond, open inactive tickets” isn’t triggered, so the status
doesn’t change, and my scrip doesn’t run</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Now over to the resolved and stalled tickets: when there is any transaction on these
tickets, user should be set to “nobody” to inform the other colleagues about this tickets.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">On the transaction, firstly the “on correspond, open inactive tickets” is triggered
and changes the state from stalled or resolved to “open”</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Now my scrip triggers this status change and changes the user to “nobody”.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">I hope you can see my idea more clear now.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">best regards</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Bernhard</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Alex Peters [mailto:<a href="mailto:alex@peters.net" target="_blank">alex@peters.net</a>]
<br>
<b>Gesendet:</b> Donnerstag, 24. Juli 2014 16:11<br>
<b>An:</b> Eierschmalz, Bernhard<br>
<b>Cc:</b> <a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a><br>
<b>Betreff:</b> Re: [rt-users] absence planning</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">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?<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">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. </span>If you move your scrip to execute before the scrip that opens inactive tickets on correspond, the interference should no longer occur.<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On 24 July 2014 23:56, Eierschmalz, Bernhard <<a href="mailto:Bernhard.Eierschmalz@scheppach.com" target="_blank">Bernhard.Eierschmalz@scheppach.com</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">So now I try:
</span><u></u><u></u></p>
<p class="MsoNormal" style="text-indent:35.4pt">
<i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">return 1 if $self->TicketObj->FirstCustomFieldValue('absent') eq "yes";</span></i><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">But it still doesn’t work. What is wrong?</span><u></u><u></u></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal" style="text-indent:35.4pt">
<span lang="EN-US">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?</span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">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)</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">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.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Best regards,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a">Bernhard</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Alex Peters [mailto:<a href="mailto:alex@peters.net" target="_blank">alex@peters.net</a>]
<br>
<b>Gesendet:</b> Donnerstag, 24. Juli 2014 15:33<br>
<b>An:</b> Eierschmalz, Bernhard<br>
<b>Cc:</b> <a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a><br>
<b>Betreff:</b> Re: [rt-users] absence planning</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">You can probably use:<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">$self->TicketObj->OwnerObj->FirstCustomFieldValue('absent')<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">to access the value of the owner's "absent" custom field.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">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?<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On 24 July 2014 23:14, Eierschmalz, Bernhard <<a href="mailto:Bernhard.Eierschmalz@scheppach.com" target="_blank">Bernhard.Eierschmalz@scheppach.com</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">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:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p><span lang="EN-US">1.</span><span lang="EN-US" style="font-size:7.0pt"> </span>
<span lang="EN-US">Creating a user’s custom field “absent” which is yes or no</span><u></u><u></u></p>
<p><span lang="EN-US">2.</span><span lang="EN-US" style="font-size:7.0pt"> </span>
<span lang="EN-US">When a user is absence, this user changes this field to yes, when he’s back he changes back to no</span><u></u><u></u></p>
<p><span lang="EN-US">3.</span><span lang="EN-US" style="font-size:7.0pt"> </span>
<span lang="EN-US">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</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">so I planned to set up this with a Scrip.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Scrip Action is easy. It’s
</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US">$self->TicketObj->SetOwner ( $RT::Nobody->id );</span></i><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<i><span lang="EN-US">Return 1;</span></i><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">What I’m having problems with is Scrip Condition.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">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</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">I tried the following line:</span><u></u><u></u></p>
<p class="MsoNormal" style="text-indent:35.4pt">
<i><span lang="EN-US">return 1 if $self->TicketObj->Owner->Customfields->CustomFieldValue(‘absent’) eq “yes”;</span></i><u></u><u></u></p>
<p class="MsoNormal"><i><span lang="EN-US"> </span></i><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">but this isn’t working. What is wrong?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">A second step will be to check, what exactly was changed (and only run if status was changed).</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">I think I can do this with
</span><u></u><u></u></p>
<p class="MsoNormal" style="text-indent:35.4pt">
<i><span lang="EN-US">return 0 unless $self->TransactionObj->Type eq “Status” </span>
</i><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">in front of the other code; am I right?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal">Best regards,<u></u><u></u></p>
<p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#888888">Bernhard,</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><br>
--<br>
RT Training - Boston, September 9-10<br>
<a href="http://bestpractical.com/training" target="_blank">http://bestpractical.com/training</a><u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
<br>--<br>
RT Training - Boston, September 9-10<br>
<a href="http://bestpractical.com/training" target="_blank">http://bestpractical.com/training</a><br></blockquote></div><br></div>