<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 11 October 2013 03:54, globo <span dir="ltr"><<a href="mailto:michael.obrien@globoforce.com" target="_blank">michael.obrien@globoforce.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am trying to create a custom field with Yes / No options.<br>
<br>
If Yes is selected the custom Field would load a template and No won't load<br>
the template.<br>
<br>
I am using the following code in my script under Custom Condition<br>
<br>
Condition: User Defined<br>
<br>
$self->TicketObj->FirstCustomFieldValue("Custom Field Name") ne "Yes")<br>
<br>
I'm not a programmer so I am struggling to figure how to get this working.</blockquote><div><br></div><div style><span style="font-family:arial,sans-serif">In RT most of these things have to return something so RT knows something was done or knows the condition is true. This is true for conditions and actions. </span></div>
<div style><br></div><div style>For the condition:</div><div style><span style="font-family:'courier new',monospace;font-size:13px">return 0 unless $self->TicketObj-></span><span style="font-family:'courier new',monospace;font-size:13px">FirstCustomFieldValue("Custom Field Name") eq "Yes";</span><br>
</div><div style><div><font face="courier new, monospace"><span style="font-size:13px">return 0 unless $self->TicketObj->FirstCustomFieldValue(</span><span style="font-size:13px">"Custom Field Name") ne "";</span></font></div>
<div><span style="font-size:13px"><font face="courier new, monospace">return 1;</font></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">Or just simply a one liner (functionally the same as above):</span></div>
<div style><div><font face="courier new, monospace"><span style="font-size:13px">return 1 if $self->TicketObj-></span><span style="font-size:13px">FirstCustomFieldValue("Custom Field Name") eq "Yes";</span></font></div>
<div><br></div></div></div><div style><font face="arial, sans-serif">It'll return zero unless that custom field is set to Yes (case matters in both examples).</font></div><div style><font face="arial, sans-serif"><br>
</font></div></div>-- <br><div dir="ltr"><div><span style="font-family:arial;font-size:small">Landon Stewart :: </span><a href="mailto:lstewart@iweb.com" style="font-family:arial;font-size:small" target="_blank">lstewart@iweb.com</a><br>
</div><span style="font-family:arial;font-size:small">Lead Specialist, Abuse and Security Management</span><br style="font-family:arial;font-size:small"><span style="font-family:arial;font-size:small">Spécialiste principal, gestion des abus et sécurité</span><br style="font-family:arial;font-size:small">
<span style="font-family:arial;font-size:small"><a href="http://iweb.com" target="_blank">http://iweb.com</a> :: +1 (888) 909-4932</span><br><div><span style="font-family:arial;font-size:small"><br></span></div><div><span style="font-family:arial;font-size:small"><br>
</span></div></div>
</div></div>