Running scrips

Need help figuring out how scrips fire.

I have the following scrips most scrips are custom actions and all work using the rt-crontool. The issue I am have is the last scrip depends on the previous scrip changing CF which seems to be the problem. Scrip “3A Retrieve Items from RapidTrax” depends on the previous scrips to change CF I have the “3A Retrieve Items from RapidTrax” outputting a debug log of what the CF are set to at start time and at that time they are all blank but if I open the ticket the fields have values and if I run the scrip using the rt-crontool after viewing the ticket then it will do the work needed.

I have set these scrips up using the normal mode and the batch mode and I have used custom actions and custom conditions. If was comparing this to a database it like the commit commands needs to be executed.

Is there a timer that I need to set to wait for?
Is there a commit command I need to use?

54http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=54

2A Update Custom Fields Emails from Scalerthttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=54

On Create

Update CF for Scalert

Blank

Enabled

[Up] [Down]

83http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=83

2A Update Custom Fields for Big Lotshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=83

On Create

Update CF for BigLots

Blank

Enabled

[Up] [Down]

16http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=16

2A Update Custom Fields for Emails From Tjxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=16

On Create

Update CF for Tjx

Blank

Enabled

[Up] [Down]

38http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=38

2A Update Custom Fields for Family Dollarhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=38

On Create

Update CF for SmsAssist

Blank

Enabled

[Up] [Down]

91http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=91

2A Update Custom Fields for Gnchttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=91

On Create

Update CF for GNC

Blank

Enabled

[Up] [Down]

17http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=17

2A Update Custom Fields for Home Depothttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=17

On Create

Update CF for RusComp

Blank

Enabled

[Up] [Down]

92http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=92

2A Update Custom Fields for Jack In The Boxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=92

On Create

Update CF for Corrigo

Blank

Enabled

[Up] [Down]

56http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=56

2A Update Custom Fields for Message from Spectrumhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=56

On Create

Update CF for Spectrum

Blank

Enabled

[Up] [Down]

94http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=94

2A Update Custom Fields for Nhaschoolshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=94

On Create

Update CF for Nhaschools

Blank

Enabled

[Up] [Down]

93http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=93

2A Update Custom Fields for Party Cityhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=93

On Create

Update CF for fmpilot2

Blank

Enabled

[Up] [Down]

29http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=29

2A Update Custom Fields for Ross Dress For Lesshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=29

On Create

Update CF for Ros

Blank

Enabled

[Up] [Down]

14http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=14

2A Update Custom Fields for Starbucks Corporationhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=14

On Create

Update CF for Starbucks

Blank

Enabled

[Up] [Down]

13http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=13

2A Update Custom Fields for Target Corporationhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=13

On Create

Update CF for Target

Blank

Enabled

[Up] [Down]

15http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=15

2A Update Custom Fields for Walgreenshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=15

On Create

Update CF for Cbre

Blank

Enabled

[Up] [Down]

100http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=100

2A Update CF for Service Changehttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=100

On Create

Update CF for Service Change

Blank

Enabled

[Up] [Down]

40http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=40

3B Change Priorityhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=40

On Create

User Defined

Blank

Enabled

[Up] [Down]

35http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=35

4A Assign Ticket on Create CSR.http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=35

On Create

User Defined

Blank

Enabled

[Up] [Down]

73http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=73

4B Change Queue when Assignedhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=73

On Owner Change

User Defined

Blank

Enabled

[Up] [Down]

99http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=99

3A Retrieve Items from RapidTraxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=99

On Create

Retrive RapidTrax Data

Blank

Enabled

[Up] [Down]
Bottom of Form

Thanks in advance for the help.

Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 * 262-783-6261 ext. 2296
bbaker@copesan.commailto:cstephan@copesan.com
www.copesan.comhttp://www.copesan.com/
“Servicing North America with Local Care”

Is there a way to force a scrip to commit immediately? Or have the last scrip prepare after the commit has happened on all the other scrips?

When I watch the log I see commits happening after all scrips have been prepared.

Thanks

Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 * 262-783-6261 ext. 2296
bbaker@copesan.commailto:cstephan@copesan.com
www.copesan.comhttp://www.copesan.com/
"Servicing North America with Local Care"From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Bryon Baker
Sent: Tuesday, March 25, 2014 1:35 PM
To: RT Users (rt-users@lists.bestpractical.com)
Subject: [rt-users] Running scrips

Need help figuring out how scrips fire.

I have the following scrips most scrips are custom actions and all work using the rt-crontool. The issue I am have is the last scrip depends on the previous scrip changing CF which seems to be the problem. Scrip “3A Retrieve Items from RapidTrax” depends on the previous scrips to change CF I have the “3A Retrieve Items from RapidTrax” outputting a debug log of what the CF are set to at start time and at that time they are all blank but if I open the ticket the fields have values and if I run the scrip using the rt-crontool after viewing the ticket then it will do the work needed.

I have set these scrips up using the normal mode and the batch mode and I have used custom actions and custom conditions. If was comparing this to a database it like the commit commands needs to be executed.

Is there a timer that I need to set to wait for?
Is there a commit command I need to use?

54http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=54

2A Update Custom Fields Emails from Scalerthttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=54

On Create

Update CF for Scalert

Blank

Enabled

[Up] [Down]

83http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=83

2A Update Custom Fields for Big Lotshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=83

On Create

Update CF for BigLots

Blank

Enabled

[Up] [Down]

16http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=16

2A Update Custom Fields for Emails From Tjxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=16

On Create

Update CF for Tjx

Blank

Enabled

[Up] [Down]

38http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=38

2A Update Custom Fields for Family Dollarhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=38

On Create

Update CF for SmsAssist

Blank

Enabled

[Up] [Down]

91http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=91

2A Update Custom Fields for Gnchttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=91

On Create

Update CF for GNC

Blank

Enabled

[Up] [Down]

17http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=17

2A Update Custom Fields for Home Depothttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=17

On Create

Update CF for RusComp

Blank

Enabled

[Up] [Down]

92http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=92

2A Update Custom Fields for Jack In The Boxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=92

On Create

Update CF for Corrigo

Blank

Enabled

[Up] [Down]

56http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=56

2A Update Custom Fields for Message from Spectrumhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=56

On Create

Update CF for Spectrum

Blank

Enabled

[Up] [Down]

94http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=94

2A Update Custom Fields for Nhaschoolshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=94

On Create

Update CF for Nhaschools

Blank

Enabled

[Up] [Down]

93http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=93

2A Update Custom Fields for Party Cityhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=93

On Create

Update CF for fmpilot2

Blank

Enabled

[Up] [Down]

29http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=29

2A Update Custom Fields for Ross Dress For Lesshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=29

On Create

Update CF for Ros

Blank

Enabled

[Up] [Down]

14http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=14

2A Update Custom Fields for Starbucks Corporationhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=14

On Create

Update CF for Starbucks

Blank

Enabled

[Up] [Down]

13http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=13

2A Update Custom Fields for Target Corporationhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=13

On Create

Update CF for Target

Blank

Enabled

[Up] [Down]

15http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=15

2A Update Custom Fields for Walgreenshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=15

On Create

Update CF for Cbre

Blank

Enabled

[Up] [Down]

100http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=100

2A Update CF for Service Changehttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=100

On Create

Update CF for Service Change

Blank

Enabled

[Up] [Down]

40http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=40

3B Change Priorityhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=40

On Create

User Defined

Blank

Enabled

[Up] [Down]

35http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=35

4A Assign Ticket on Create CSR.http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=35

On Create

User Defined

Blank

Enabled

[Up] [Down]

73http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=73

4B Change Queue when Assignedhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=73

On Owner Change

User Defined

Blank

Enabled

[Up] [Down]

99http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=99

3A Retrieve Items from RapidTraxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=99

On Create

Retrive RapidTrax Data

Blank

Enabled

[Up] [Down]
Bottom of Form

Thanks in advance for the help.

Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 * 262-783-6261 ext. 2296
bbaker@copesan.commailto:cstephan@copesan.com
www.copesan.comhttp://www.copesan.com/
“Servicing North America with Local Care”

Of I could do this at the end of the commit for every scrip that is updating the CF’s.

if (RT::Action::RetriveDataFromRapidTrax::Prepare($self->TicketObj))

{

RT::Action::RetriveDataFromRapidTrax::Commit()

}

If I do that how would I pass the ticket object to that external module?

Thanks

Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 * 262-783-6261 ext. 2296
bbaker@copesan.commailto:cstephan@copesan.com
www.copesan.comhttp://www.copesan.com/
"Servicing North America with Local Care"From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Bryon Baker
Sent: Tuesday, March 25, 2014 2:12 PM
To: RT Users (rt-users@lists.bestpractical.com)
Subject: Re: [rt-users] Running scrips

Is there a way to force a scrip to commit immediately? Or have the last scrip prepare after the commit has happened on all the other scrips?

When I watch the log I see commits happening after all scrips have been prepared.

Thanks

Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 * 262-783-6261 ext. 2296
bbaker@copesan.commailto:cstephan@copesan.com
www.copesan.comhttp://www.copesan.com/
“Servicing North America with Local Care”

From: rt-users-bounces@lists.bestpractical.commailto:rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Bryon Baker
Sent: Tuesday, March 25, 2014 1:35 PM
To: RT Users (rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com)
Subject: [rt-users] Running scrips

Need help figuring out how scrips fire.

I have the following scrips most scrips are custom actions and all work using the rt-crontool. The issue I am have is the last scrip depends on the previous scrip changing CF which seems to be the problem. Scrip “3A Retrieve Items from RapidTrax” depends on the previous scrips to change CF I have the “3A Retrieve Items from RapidTrax” outputting a debug log of what the CF are set to at start time and at that time they are all blank but if I open the ticket the fields have values and if I run the scrip using the rt-crontool after viewing the ticket then it will do the work needed.

I have set these scrips up using the normal mode and the batch mode and I have used custom actions and custom conditions. If was comparing this to a database it like the commit commands needs to be executed.

Is there a timer that I need to set to wait for?
Is there a commit command I need to use?

54http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=54

2A Update Custom Fields Emails from Scalerthttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=54

On Create

Update CF for Scalert

Blank

Enabled

[Up] [Down]

83http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=83

2A Update Custom Fields for Big Lotshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=83

On Create

Update CF for BigLots

Blank

Enabled

[Up] [Down]

16http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=16

2A Update Custom Fields for Emails From Tjxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=16

On Create

Update CF for Tjx

Blank

Enabled

[Up] [Down]

38http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=38

2A Update Custom Fields for Family Dollarhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=38

On Create

Update CF for SmsAssist

Blank

Enabled

[Up] [Down]

91http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=91

2A Update Custom Fields for Gnchttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=91

On Create

Update CF for GNC

Blank

Enabled

[Up] [Down]

17http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=17

2A Update Custom Fields for Home Depothttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=17

On Create

Update CF for RusComp

Blank

Enabled

[Up] [Down]

92http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=92

2A Update Custom Fields for Jack In The Boxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=92

On Create

Update CF for Corrigo

Blank

Enabled

[Up] [Down]

56http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=56

2A Update Custom Fields for Message from Spectrumhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=56

On Create

Update CF for Spectrum

Blank

Enabled

[Up] [Down]

94http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=94

2A Update Custom Fields for Nhaschoolshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=94

On Create

Update CF for Nhaschools

Blank

Enabled

[Up] [Down]

93http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=93

2A Update Custom Fields for Party Cityhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=93

On Create

Update CF for fmpilot2

Blank

Enabled

[Up] [Down]

29http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=29

2A Update Custom Fields for Ross Dress For Lesshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=29

On Create

Update CF for Ros

Blank

Enabled

[Up] [Down]

14http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=14

2A Update Custom Fields for Starbucks Corporationhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=14

On Create

Update CF for Starbucks

Blank

Enabled

[Up] [Down]

13http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=13

2A Update Custom Fields for Target Corporationhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=13

On Create

Update CF for Target

Blank

Enabled

[Up] [Down]

15http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=15

2A Update Custom Fields for Walgreenshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=15

On Create

Update CF for Cbre

Blank

Enabled

[Up] [Down]

100http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=100

2A Update CF for Service Changehttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=100

On Create

Update CF for Service Change

Blank

Enabled

[Up] [Down]

40http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=40

3B Change Priorityhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=40

On Create

User Defined

Blank

Enabled

[Up] [Down]

35http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=35

4A Assign Ticket on Create CSR.http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=35

On Create

User Defined

Blank

Enabled

[Up] [Down]

73http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=73

4B Change Queue when Assignedhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=73

On Owner Change

User Defined

Blank

Enabled

[Up] [Down]

99http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=99

3A Retrieve Items from RapidTraxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=99

On Create

Retrive RapidTrax Data

Blank

Enabled

[Up] [Down]
Bottom of Form

Thanks in advance for the help.

Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 * 262-783-6261 ext. 2296
bbaker@copesan.commailto:cstephan@copesan.com
www.copesan.comhttp://www.copesan.com/
“Servicing North America with Local Care”

Is there a way to force a scrip to commit immediately?

Don’t know.

Or have the last scrip prepare after the commit has happened on all the other scrips?

Sounds like you want the last scrip set as Batch, and the others set as Normal (CreateTransaction).

Batch scrip run after all the commits from Normal scrips.

Or could you take another approach and have the scrips that depend on the CF changing fire on a “On Transaction” with prepare code that checks for the specific custom field.

I believe normal scrips will cause transactions which in turn can cause more scrips to fire.

Regards,

Gareth

I have an update I figured out how to address my issue and thought I would let everyone know.

The code in the scrips that was updating the CF was in the Commit sub of the custom action. I move the code from that sub to the Prepare sub. I am not sure this is best practice for Request Tracker but all is working now.

Thanks for the input.

Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 * 262-783-6261 ext. 2296
bbaker@copesan.commailto:cstephan@copesan.com
www.copesan.comhttp://www.copesan.com/
"Servicing North America with Local Care"From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Bryon Baker
Sent: Tuesday, March 25, 2014 2:12 PM
To: RT Users (rt-users@lists.bestpractical.com)
Subject: Re: [rt-users] Running scrips

Is there a way to force a scrip to commit immediately? Or have the last scrip prepare after the commit has happened on all the other scrips?

When I watch the log I see commits happening after all scrips have been prepared.

Thanks

Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 * 262-783-6261 ext. 2296
bbaker@copesan.commailto:cstephan@copesan.com
www.copesan.comhttp://www.copesan.com/
“Servicing North America with Local Care”

From: rt-users-bounces@lists.bestpractical.commailto:rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Bryon Baker
Sent: Tuesday, March 25, 2014 1:35 PM
To: RT Users (rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com)
Subject: [rt-users] Running scrips

Need help figuring out how scrips fire.

I have the following scrips most scrips are custom actions and all work using the rt-crontool. The issue I am have is the last scrip depends on the previous scrip changing CF which seems to be the problem. Scrip “3A Retrieve Items from RapidTrax” depends on the previous scrips to change CF I have the “3A Retrieve Items from RapidTrax” outputting a debug log of what the CF are set to at start time and at that time they are all blank but if I open the ticket the fields have values and if I run the scrip using the rt-crontool after viewing the ticket then it will do the work needed.

I have set these scrips up using the normal mode and the batch mode and I have used custom actions and custom conditions. If was comparing this to a database it like the commit commands needs to be executed.

Is there a timer that I need to set to wait for?
Is there a commit command I need to use?

54http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=54

2A Update Custom Fields Emails from Scalerthttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=54

On Create

Update CF for Scalert

Blank

Enabled

[Up] [Down]

83http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=83

2A Update Custom Fields for Big Lotshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=83

On Create

Update CF for BigLots

Blank

Enabled

[Up] [Down]

16http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=16

2A Update Custom Fields for Emails From Tjxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=16

On Create

Update CF for Tjx

Blank

Enabled

[Up] [Down]

38http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=38

2A Update Custom Fields for Family Dollarhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=38

On Create

Update CF for SmsAssist

Blank

Enabled

[Up] [Down]

91http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=91

2A Update Custom Fields for Gnchttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=91

On Create

Update CF for GNC

Blank

Enabled

[Up] [Down]

17http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=17

2A Update Custom Fields for Home Depothttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=17

On Create

Update CF for RusComp

Blank

Enabled

[Up] [Down]

92http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=92

2A Update Custom Fields for Jack In The Boxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=92

On Create

Update CF for Corrigo

Blank

Enabled

[Up] [Down]

56http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=56

2A Update Custom Fields for Message from Spectrumhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=56

On Create

Update CF for Spectrum

Blank

Enabled

[Up] [Down]

94http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=94

2A Update Custom Fields for Nhaschoolshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=94

On Create

Update CF for Nhaschools

Blank

Enabled

[Up] [Down]

93http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=93

2A Update Custom Fields for Party Cityhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=93

On Create

Update CF for fmpilot2

Blank

Enabled

[Up] [Down]

29http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=29

2A Update Custom Fields for Ross Dress For Lesshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=29

On Create

Update CF for Ros

Blank

Enabled

[Up] [Down]

14http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=14

2A Update Custom Fields for Starbucks Corporationhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=14

On Create

Update CF for Starbucks

Blank

Enabled

[Up] [Down]

13http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=13

2A Update Custom Fields for Target Corporationhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=13

On Create

Update CF for Target

Blank

Enabled

[Up] [Down]

15http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=15

2A Update Custom Fields for Walgreenshttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=15

On Create

Update CF for Cbre

Blank

Enabled

[Up] [Down]

100http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=100

2A Update CF for Service Changehttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=100

On Create

Update CF for Service Change

Blank

Enabled

[Up] [Down]

40http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=40

3B Change Priorityhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=40

On Create

User Defined

Blank

Enabled

[Up] [Down]

35http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=35

4A Assign Ticket on Create CSR.http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=35

On Create

User Defined

Blank

Enabled

[Up] [Down]

73http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=73

4B Change Queue when Assignedhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=73

On Owner Change

User Defined

Blank

Enabled

[Up] [Down]

99http://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=99

3A Retrieve Items from RapidTraxhttp://testhelpdesk.copesan.com/rt/Admin/Scrips/Modify.html?id=99

On Create

Retrive RapidTrax Data

Blank

Enabled

[Up] [Down]
Bottom of Form

Thanks in advance for the help.

Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 * 262-783-6261 ext. 2296
bbaker@copesan.commailto:cstephan@copesan.com
www.copesan.comhttp://www.copesan.com/
“Servicing North America with Local Care”

The code in the scrips that was updating the CF was in the Commit sub of the custom action. I
move the code from that sub to the Prepare sub. I am not sure this is best practice for
Request Tracker but all is working now.

For the list archives, this is a really bad idea.
Code that runs in the Prepare section of a User Defined Scrip Action
will potentially be triggered when clicking Reply or Comment on a
ticket, or when visiting the People page of a ticket. It depends on
what the Condition of this Scrip is, but it can be quite dangerous.

As another user suggested, Batch scrips are likely the solution you’re
seeking.

-kevin

I tried batch scrips the scrips are also Custom Actions and only fire on Create.

As I explained in the earlier message the commits don’t seem to be committed by the time the last scrip tests its prepare and the prepare fails therefore being left out of the commit sequence.

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 . 262-783-6261 ext. 2296
bbaker@copesan.com

“Servicing North America with Local Care”-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin Falcone
Sent: Thursday, March 27, 2014 2:07 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Running scrips

On Thu, Mar 27, 2014 at 03:19:56PM +0000, Bryon Baker wrote:

The code in the scrips that was updating the CF was in the Commit sub of the custom action. I
move the code from that sub to the Prepare sub. I am not sure this is best practice for
Request Tracker but all is working now.

For the list archives, this is a really bad idea.
Code that runs in the Prepare section of a User Defined Scrip Action will potentially be triggered when clicking Reply or Comment on a ticket, or when visiting the People page of a ticket. It depends on what the Condition of this Scrip is, but it can be quite dangerous.

As another user suggested, Batch scrips are likely the solution you’re seeking.

-kevin