[rt-users] rt-crontool - "increase" the value of a CF.

Bart bart at pleh.info
Wed Nov 23 13:23:54 EST 2011


Hi Kevin,

Thanks for the reply,

Guess I'll have to learn Perl a bit more then and experiment a little with
this.

Will post the results once I've gained some progress.

-- Bart


Op 23 november 2011 18:08 schreef Kevin Falcone
<falcone at bestpractical.com>het volgende:

> On Wed, Nov 23, 2011 at 05:25:01PM +0100, Bart wrote:
> >    I've then created a simple rt-crontool command to see if I could find
> a ticket and if I could
> >    set a value when I found that ticket. This worked as well, below the
> result:
> >    /opt/rt4/bin/rt-crontool \
> >            --search RT::Search::FromSQL \
> >            --search-arg "status = 'open'" \
> >            --action RT::Action::SetPriority --action-arg 3 \
> >            --verbose
> >    So now for the question(s):
> >
> >      * First a simple one, how do I set a value for a custom field?
> >      * And the more difficult one, how do I increase a value instead of
> replacing it? (adding +
> >        or something like that doesn't seem to work)
> >
> >    Hopefully this is possible with the rt-crontool, if not then I'd like
> to hear your thoughts on
> >    how I'd be able to do the above in a different manner.
>
> Unfortunately, you'll need to write your own RT::Action to change the CF
>
> You could turn this into a pretty trivial perl script using the RT API
> and calling $tickets->FromSQL("status = 'open'") and then iterating
> the list to call AddCustomFieldValue
>
> -kevin
>
> --------
> RT Training Sessions (http://bestpractical.com/services/training.html)
> *  Barcelona, Spain — November 28 & 29, 2011
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20111123/ed68cf4b/attachment.htm>


More information about the rt-users mailing list