Hi,<br><br>I've been trying to create a callback for adding the Queue change field to tue comment/reply page. (update.html)<br><br>In order to do so I've been using the existing Extension "RT::Extension::CustomFieldsOnUpdate" as an example.<br>
Initially to add the Queue field to this extension and to see if it will eventually work.<br><br>Location of the callback files, as far as I could judge this is the only location where I would need to edit the files:<br><br>
<blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span style="font-family:courier new,monospace">/opt/rt4/local/plugins/RT-Extension-CustomFieldsOnUpdate/html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html</span><br>
</blockquote><br>The first file I've edited was the tile AfterWorked, the bold part is the thing I've added:<br><br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;font-family:courier new,monospace" class="gmail_quote">
<b><& /Elements/SelectQueue,<br>    TicketObj => $Ticket,<br>    InTable => 1,<br>    DefaultsFromTopArguments => 0,<br>&></b><br><& /Ticket/Elements/EditCustomFields,<br>    TicketObj => $Ticket,<br>
    InTable => 1,<br>    DefaultsFromTopArguments => 0,<br>&><br><%ARGS><br>$Ticket<br></%ARGS><br></blockquote><br>This alone adds the Queue field to the Update.html page. But it doesn't show the current value + when changing the value it doesn't apply this to the ticket.<br>
So I figured I needed to change the second file, BeforeUpdate, as well. But this is where I'm stuck, I don't really have an idea on what to add/how to add the SelectQueue part to this file. Below the current contents:<br>
<br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;font-family:courier new,monospace" class="gmail_quote"><%ARGS><br>$TicketObj<br>$skip_update<br>$results<br>$ARGSRef => {}<br>
</%ARGS><br><%INIT><br>return unless $ARGSRef->{'SubmitTicket'};<br><br>my $CFs = $TicketObj->CustomFields;<br>my $ValidCFs = $m->comp(<br>    '/Elements/ValidateCustomFields',<br>    CustomFields => $CFs,<br>
    NamePrefix => "Object-RT::Ticket-". $TicketObj->id ."-CustomField-",<br>    ARGSRef => $ARGSRef<br>);<br>unless ( $ValidCFs ) { <br>    $$skip_update = 1;<br>    while (my $CF = $CFs->Next) {<br>
        my $msg = $m->notes('InvalidField-' . $CF->Id) or next;<br>        push @$results, loc($CF->Name) . ': ' . $msg;<br>    }<br>}<br></%INIT><br></blockquote><br>I take it that I need to make sure that it sets the Queue value and something like that but compared to the CF code I don't really see how I should add the Queue in this.<br>
I've tried copying the above CF value, but I can't seem to get it to work (keep getting syntax errors). Basically I'm lost in translation on this one O_o<br><br>My goal is to eventually create a specific callback for this, thus not editing the CustomFieldsOnUpdate extension.<br>
Could someone with a little more experience with Callbacks shed some light on this? I would expect this to be dead simple, I just don't yet have a good grasp on the syntax and the works.<br><br>Thanks in advance.<br><br clear="all">
-- Bart<br>