Hi,<div><br></div><div>I'm currently working on making a scrip for RT4 which should eventually allow us to do the following:</div><div><ul><li>User fills in the CF ticket type: Incident, Problem or Change.</li>
<li>User fills in the CF priority: 1, 2, 3 or 4. (in this setup we chose to make this a CF so that we can restrict the values entered)</li><li>Based on the combination of those CF's the SLA field is automatically filled with the appropriate SLA for that combo.</li>
<ul><li>The SLA CF has these fixed values: Urgent, Normal, Low.</li><li>It's the SLA field that you get from the plugin.</li></ul></ul></div><div>I found this scrip on the wiki which almost does what I want:</div><div>
<ul><li><a href="http://requesttracker.wikia.com/wiki/CreatePriorityBasedOnCustomFieldValues" target="_blank">http://requesttracker.wikia.com/wiki/CreatePriorityBasedOnCustomFieldValues</a></li>
</ul></div><div>As a result I'm now looking at making a simple statement which sets the SLA based on te ticket type alone (for now).</div><div>When that part is working I would expect that expanding the scrip to also incorporate the priority wouldn't be too difficult.</div>
<div><br></div><div>This is what I've come up with so far:</div><div><ul><li>Condition: On status change</li><li>Action: User defined</li><li>Template: Global Template: Transaction</li><li>Stage: TransactionCreate</li>
</ul></div><div>Custom condition: <empty></div><div>Custom action preparation code: return 1;</div><div>Custom action cleanup code:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
my $my_type = $self->TicketObj->CustomFieldValues('Type');<br>my $my_sla = 'Urgent' if ($my_type =~ /^I/);<br>my $my_sla = 'Normal' if ($my_type =~ /^C/);<br>my $my_sla = 'Low' if ($my_type =~ /^P/);<br>
$self->TicketObj->AddCustomFieldValue( Field => 'SLA', Value => $my_sla );</blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>
<div><br></div><div>At this point I'm kinda stuck, no matter how I fill in this part it always sets the SLA field to Normal regardless of the content in the CF type.</div><div><br></div><div>Can someone point me in the right direction for this? I'd love to get this to work :)</div>
<div><br></div><div><br clear="all">Best regards,<br><br>Bart<br><br>
</div>