Rt-crontool question

I have 3 things we did from cron we updated to 4.0.2 from 3.6 and they
don’t work now. Can someone advise what I have to change

At 3 am everyday send a notification to the requestors of tickets in

custpndng untouched for 3 days

30 3 */1 * * root /opt/rt4/bin/rt-crontool --search
RT::Search::TicketsWithStatus --search-arg custpndng --condition
RT::Condition::UntouchedInHours --condition-arg 72 --action
RT::Action::NotifyFromRTSystem --action-arg Requestor --template-id 20
–verbose > /var/log/cpend7daynotifyrequestor.out

At 3 am everyday resolve tickets in custpndng untouched for 17 days

0 3 */1 * * root /opt/rt4/bin/rt-crontool --search
RT::Search::TicketsWithStatus --search-arg custpndng --condition
RT::Condition::UntouchedInHours --condition-arg 168 --action
RT::Action::SetStatus --action-arg resolved --verbose >
/var/log/cpend14dayresolve.out

At 3 am everyday send a notification to the owners of open tickets

untouched in 1 days

45 3 */1 * * root /opt/rt4/bin/rt-crontool --search
RT::Search::TicketsWithStatus --search-arg open --condition
RT::Condition::UntouchedInHours --condition-arg 24 --action
RT::Action::NotifyFromRTSystem --action-arg Owner --template-id 21
–verbose > /var/log/open3daynotifyowner.out

I get an error when they run

[crit]: Failed to load module RT::Search::TicketsWithStatus. () at
/opt/rt4/bin/rt-crontool line 307. (/opt/rt4/bin/…/lib/RT.pm:340)

Failed to load module RT::Search::TicketsWithStatus. () at
/opt/rt4/bin/rt-crontool line 307.

Thanks

Mark

I have 3 things we did from cron we updated to 4.0.2 from 3.6 and they don*t work now. Can
someone advise what I have to change

At 3 am everyday send a notification to the requestors of tickets in custpndng untouched

for 3 days

30 3 */1 * * root /opt/rt4/bin/rt-crontool --search RT::Search::TicketsWithStatus --search-arg

RT::Search::TicketsWithStatus isn’t an RT built-in. You’ll either
need to port this customization from your 3.6 install or replace it with
RT::Search::FromSQL and an arg of something like Status = ‘custpndng’

-kevin

That worked for the most part but now it has an issue sending out the
email using SendEmailFromRTSystem it breaks on

my $creator = $self->TransactionObj->CreatorObj->EmailAddress();

I have tried several other actions and they all do the same thing

Any suggestions

MarkFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin
Falcone
Sent: Friday, February 03, 2012 2:01 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] rt-crontool question

I have 3 things we did from cron we updated to 4.0.2 from 3.6 and
they don*t work now. Can
someone advise what I have to change

At 3 am everyday send a notification to the requestors of tickets

in custpndng untouched

for 3 days

30 3 */1 * * root /opt/rt4/bin/rt-crontool --search
RT::Search::TicketsWithStatus --search-arg

RT::Search::TicketsWithStatus isn’t an RT built-in. You’ll either
need to port this customization from your 3.6 install or replace it with
RT::Search::FromSQL and an arg of something like Status = ‘custpndng’

-kevin

custpndng --condition RT::Condition::UntouchedInHours --condition-arg
72 --action
RT::Action::NotifyFromRTSystem --action-arg Requestor --template-id
20 --verbose >
/var/log/cpend7daynotifyrequestor.out

At 3 am everyday resolve tickets in custpndng untouched for 17

days

0 3 */1 * * root /opt/rt4/bin/rt-crontool --search
RT::Search::TicketsWithStatus --search-arg
custpndng --condition RT::Condition::UntouchedInHours --condition-arg
168 --action
RT::Action::SetStatus --action-arg resolved --verbose >
/var/log/cpend14dayresolve.out

At 3 am everyday send a notification to the owners of open tickets

untouched in 1 days

45 3 */1 * * root /opt/rt4/bin/rt-crontool --search
RT::Search::TicketsWithStatus --search-arg
open --condition RT::Condition::UntouchedInHours --condition-arg 24
–action
RT::Action::NotifyFromRTSystem --action-arg Owner --template-id 21
–verbose >
/var/log/open3daynotifyowner.out

I get an error when they run

[crit]: Failed to load module RT::Search::TicketsWithStatus. () at
/opt/rt4/bin/rt-crontool
line 307. (/opt/rt4/bin/…/lib/RT.pm:340)

Failed to load module RT::Search::TicketsWithStatus. () at
/opt/rt4/bin/rt-crontool line 307.

That worked for the most part but now it has an issue sending out the
email using SendEmailFromRTSystem it breaks on

my $creator = $self->TransactionObj->CreatorObj->EmailAddress();

I have tried several other actions and they all do the same thing

I forgot to mention that SendEmailFromRTSysten is also a custom
action you’ll need to forward port. You might get away with the
Notify action, you’ll definitely need to provide the --transaction
command line argument, which you can read more about in the initial
–help.

-kevin

Ok I changed everything and still get errors

/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL --search-arg “Status
= ‘open’” --condition RT::Condition::UntouchedInHours --condition-arg
’1’–action RT::Action::NotifyGroup --action-arg ‘$owner’ --template
’21’ --transaction ‘last’ transaction-type ‘Correspond’ --verbose >
/var/log/open3daynotifyowner.out

Any ideas the output is the rtcrontool help menu

Mark

Ok I changed everything and still get errors

/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL --search-arg “Status
= ‘open’” --condition RT::Condition::UntouchedInHours --condition-arg
’1’–action RT::Action::NotifyGroup --action-arg ‘$owner’ --template

Is there a space between ‘1’ and --action? If not, the command isn’t
seeing the action argument.

I’ll also note that I’m not sure what $owner is in your usage above.

-kevin

I am trying to get it to notify whoever the owner of the ticket is and
that is from what I can see is the variable for the tickets owner

mark

/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL --search-arg “Status
= ‘open’” --condition RT::Condition::UntouchedInHours --condition-arg
’1’–action RT::Action::NotifyGroup --action-arg ‘$owner’ --template

Is there a space between ‘1’ and --action? If not, the command isn’t
seeing the action argument.

I’ll also note that I’m not sure what $owner is in your usage above.

I am trying to get it to notify whoever the owner of the ticket is and
that is from what I can see is the variable for the tickets owner

That isn’t how that action works. It sounds like you want Notify and
to pass the argument Owner, not $owner.

-kevin

Correct but Owner does not work neither does anything I seem to enter this
is the error with Owner

[error]: ‘Owner’ is not principal id, group name, user name, user email
address or any email address
(/opt/rt4/bin/…/lib/RT/Action/NotifyGroup.pm:131)

MarkFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin
Falcone
Sent: Tuesday, February 07, 2012 5:33 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] rt-crontool question

/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL --search-arg
“Status
= ‘open’” --condition RT::Condition::UntouchedInHours
–condition-arg
‘1’–action RT::Action::NotifyGroup --action-arg ‘$owner’
–template

Is there a space between ‘1’ and --action? If not, the command isn’t
seeing the action argument.

I’ll also note that I’m not sure what $owner is in your usage above.

I am trying to get it to notify whoever the owner of the ticket is and
that is from what I can see is the variable for the tickets owner

That isn’t how that action works. It sounds like you want Notify and
to pass the argument Owner, not $owner.

-kevin

Correct but Owner does not work neither does anything I seem to enter this
is the error with Owner

[error]: ‘Owner’ is not principal id, group name, user name, user email
address or any email address
(/opt/rt4/bin/…/lib/RT/Action/NotifyGroup.pm:131)

You’re still using RT::Action::NotifyGroup. Kevin suggested you use
RT::Action::Notify, which should take ‘Owner’.