Did some reading on the RT-Tool page ( <a href="http://requesttracker.wikia.com/wiki/UseRtTool">http://requesttracker.wikia.com/wiki/UseRtTool</a> ) and found this command:<div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">bin/rt list -i "Queue = 'testqueue'" | bin/rt edit - set status=resolved</font></div>
<div><br></div><div>I'm lacking the documentation and our test environment a.t.m. (am at home). So I'll do some experimenting in the test environment tomorrow at work, hopefully it will show me some nice results ^_^</div>
<div><br></div><div><br clear="all">-- Bart<br>
<br><br><div class="gmail_quote">Op 23 november 2011 19:57 schreef Bart <span dir="ltr"><<a href="mailto:bart@pleh.info">bart@pleh.info</a>></span> het volgende:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Yan,<div><br></div><div>I'll also have a look at the rt script and see if I can manage it using that, thanks :)</div><div><br clear="all">-- Bart<br>
<br><br><div class="gmail_quote">Op 23 november 2011 19:50 schreef Yan Seiner <span dir="ltr"><<a href="mailto:yan@seiner.com" target="_blank">yan@seiner.com</a>></span> het volgende:<div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Wouldn't this work (snippet from a bigger script):<br>
<br>
# and set custom fields<br>
/opt/rt4/bin/rt edit ticket/${ticket} set 'CF.{contractor}'="${contractor}"<br>
/opt/rt4/bin/rt edit ticket/${ticket} set 'CF.{amount}'="${amount}"<br>
<br>
That's how I set custom fields. You could get the value that way,<br>
increment it or whatever in a script, and then set it again.<br>
<div><div><br>
<br>
<br>
On Wed, November 23, 2011 10:23 am, Bart wrote:<br>
> Hi Kevin,<br>
><br>
> Thanks for the reply,<br>
><br>
> Guess I'll have to learn Perl a bit more then and experiment a little with<br>
> this.<br>
><br>
> Will post the results once I've gained some progress.<br>
><br>
> -- Bart<br>
><br>
><br>
> Op 23 november 2011 18:08 schreef Kevin Falcone<br>
> <<a href="mailto:falcone@bestpractical.com" target="_blank">falcone@bestpractical.com</a>>het volgende:<br>
><br>
>> On Wed, Nov 23, 2011 at 05:25:01PM +0100, Bart wrote:<br>
>> > I've then created a simple rt-crontool command to see if I could<br>
>> find<br>
>> a ticket and if I could<br>
>> > set a value when I found that ticket. This worked as well, below<br>
>> the<br>
>> result:<br>
>> > /opt/rt4/bin/rt-crontool \<br>
>> > --search RT::Search::FromSQL \<br>
>> > --search-arg "status = 'open'" \<br>
>> > --action RT::Action::SetPriority --action-arg 3 \<br>
>> > --verbose<br>
>> > So now for the question(s):<br>
>> ><br>
>> > * First a simple one, how do I set a value for a custom field?<br>
>> > * And the more difficult one, how do I increase a value instead<br>
>> of<br>
>> replacing it? (adding +<br>
>> > or something like that doesn't seem to work)<br>
>> ><br>
>> > Hopefully this is possible with the rt-crontool, if not then I'd<br>
>> like<br>
>> to hear your thoughts on<br>
>> > how I'd be able to do the above in a different manner.<br>
>><br>
>> Unfortunately, you'll need to write your own RT::Action to change the CF<br>
>><br>
>> You could turn this into a pretty trivial perl script using the RT API<br>
>> and calling $tickets->FromSQL("status = 'open'") and then iterating<br>
>> the list to call AddCustomFieldValue<br>
>><br>
>> -kevin<br>
>><br>
>> --------<br>
>> RT Training Sessions (<a href="http://bestpractical.com/services/training.html" target="_blank">http://bestpractical.com/services/training.html</a>)<br>
>> * Barcelona, Spain — November 28 & 29, 2011<br>
>><br>
><br>
><br>
</div></div>> !DSPAM:4ecd3a6094962612618147!<br>
<div>> --------<br>
> RT Training Sessions (<a href="http://bestpractical.com/services/training.html" target="_blank">http://bestpractical.com/services/training.html</a>)<br>
> * Barcelona, Spain ? November 28 & 29, 2011<br>
><br>
</div>> !DSPAM:4ecd3a6094962612618147!<br>
><br>
<span><font color="#888888"><br>
<br>
--<br>
Pain is temporary. It may last a minute, or an hour, or a day, or a year,<br>
but eventually it will subside and something else will take its place. If<br>
I quit, however, it lasts forever.<br>
<br>
</font></span></blockquote></div></div></div><br></div>
</blockquote></div><br></div>