For RTIR are scrips ran before plugins? (namely lib/RT/Action/RTIR_FindIP.pm)

Hello,

As many of you know RTIR has three levels of tickets each with their own
queue. Reports come into “Incident Reports”, incidents are created in
“Incidents” and investigations are created in “Investigations”. I’m
attempting to write a scrip that looks at the IP field of a ticket created
in “Incident Reports” and searches for tickets in “Incidents”. If it finds
one (or more) it’ll create a HasMember link. If it doesn’t I might make it
create an Incident with the text from the Incident Report.

My question is when the scrips run the IP field appears to be empty at the
time it runs. Is this normal? What order do things happen in RT and RTIR
plugins? Can I tweak this order to ensure that the IP Custom Field is
populated via lib/RT/Action/RTIR_FindIP.pm before a scrip runs? Is the
only way to append the scrip to the end of RTIR_FindIP.pm?

Thank you.

Landon Stewart LandonStewart@Gmail.com

Hello,

As many of you know RTIR has three levels of tickets each with their own
queue. Reports come into “Incident Reports”, incidents are created in
“Incidents” and investigations are created in “Investigations”. I’m
attempting to write a scrip that looks at the IP field of a ticket created
in “Incident Reports” and searches for tickets in “Incidents”. If it finds
one (or more) it’ll create a HasMember link. If it doesn’t I might make it
create an Incident with the text from the Incident Report.

My question is when the scrips run the IP field appears to be empty at the
time it runs. Is this normal? What order do things happen in RT and RTIR
plugins? Can I tweak this order to ensure that the IP Custom Field is
populated via lib/RT/Action/RTIR_FindIP.pm before a scrip runs? Is the
only way to append the scrip to the end of RTIR_FindIP.pm?

In RT 3.8 and 4.0 scrips are executed in order of description. You can add
digital prefix to description to adjust order.

Thank you.


Landon Stewart LandonStewart@Gmail.com


RT Training in Seattle, June 19-20: http://bestpractical.com/training

Best regards, Ruslan.

Oh ok that’s good. So to confirm if I wish to ensure a scrip runs last I
could prefix the description with “z0 Description” or “z1 Description”?
Naturally adding a number first would probably make it run before all the
other scrips that start with alpha characters. Correct?On 6 June 2013 13:09, Ruslan Zakirov ruz@bestpractical.com wrote:

On Thu, Jun 6, 2013 at 11:06 PM, Landon landonstewart@gmail.com wrote:

Hello,

As many of you know RTIR has three levels of tickets each with their own
queue. Reports come into “Incident Reports”, incidents are created in
“Incidents” and investigations are created in “Investigations”. I’m
attempting to write a scrip that looks at the IP field of a ticket created
in “Incident Reports” and searches for tickets in “Incidents”. If it finds
one (or more) it’ll create a HasMember link. If it doesn’t I might make it
create an Incident with the text from the Incident Report.

My question is when the scrips run the IP field appears to be empty at
the time it runs. Is this normal? What order do things happen in RT and
RTIR plugins? Can I tweak this order to ensure that the IP Custom Field is
populated via lib/RT/Action/RTIR_FindIP.pm before a scrip runs? Is the
only way to append the scrip to the end of RTIR_FindIP.pm?

In RT 3.8 and 4.0 scrips are executed in order of description. You can add
digital prefix to description to adjust order.

Thank you.


Landon Stewart LandonStewart@Gmail.com


RT Training in Seattle, June 19-20: http://bestpractical.com/training


Best regards, Ruslan.

Landon Stewart LandonStewart@Gmail.com

Oh ok that’s good. So to confirm if I wish to ensure a scrip runs last I
could prefix the description with “z0 Description” or “z1 Description”?
Naturally adding a number first would probably make it run before all the
other scrips that start with alpha characters. Correct?

yes, use SQL to check:

select Description from Scrips order by Description;

[RTIR] prefix is also accounted, so you have to know where DB places it
while sorting.

Hello,

As many of you know RTIR has three levels of tickets each with their own
queue. Reports come into “Incident Reports”, incidents are created in
“Incidents” and investigations are created in “Investigations”. I’m
attempting to write a scrip that looks at the IP field of a ticket created
in “Incident Reports” and searches for tickets in “Incidents”. If it finds
one (or more) it’ll create a HasMember link. If it doesn’t I might make it
create an Incident with the text from the Incident Report.

My question is when the scrips run the IP field appears to be empty at
the time it runs. Is this normal? What order do things happen in RT and
RTIR plugins? Can I tweak this order to ensure that the IP Custom Field is
populated via lib/RT/Action/RTIR_FindIP.pm before a scrip runs? Is the
only way to append the scrip to the end of RTIR_FindIP.pm?

In RT 3.8 and 4.0 scrips are executed in order of description. You can
add digital prefix to description to adjust order.

Thank you.


Landon Stewart LandonStewart@Gmail.com


RT Training in Seattle, June 19-20: http://bestpractical.com/training


Best regards, Ruslan.


Landon Stewart LandonStewart@Gmail.com

Best regards, Ruslan.

Oops forgot to CC the list.On 6 June 2013 13:23, Ruslan Zakirov ruz@bestpractical.com wrote:

yes, use SQL to check:

select Description from Scrips order by Description;

[RTIR] prefix is also accounted, so you have to know where DB places it
while sorting.

Thank you that makes sense. I still have a bit of an issue with the order
of things. If I use “On Create” as the condition the scrip fires earlier
than the order by Description and there are no IP addresses in the custom
field at that point. If I use a User Defined condition the IP address
custom field is already populated by that time. The problem with using a
User Defined condition is that it has the potential to fire more than once
if I base it on something to do with the ticket that might happen more than
once in the ticket’s life. I only want to do this process once on the
original content of the ticket so On Create makes the most sense.

Any idea how I can get a condition that that will only fire once per ticket
on creation or otherwise but going by the order of scrips that indicated by
the SQL query?

Landon Stewart LandonStewart@Gmail.com

yes, use SQL to check:

select Description from Scrips order by Description;

[RTIR] prefix is also accounted, so you have to know where DB places it
while sorting.

Thank you that makes sense. I still have a bit of an issue with the order
of things. If I use “On Create” as the condition the scrip fires earlier
than the order by Description and there are no IP addresses in the custom
field at that point. If I use a User Defined condition the IP address
custom field is already populated by that time. The problem with using a
User Defined condition is that it has the potential to fire more than once
if I base it on something to do with the ticket that might happen more than
once in the ticket’s life. I only want to do this process once on the
original content of the ticket so On Create makes the most sense.

Any idea how I can get a condition that that will only fire once per
ticket on creation or otherwise but going by the order of scrips that
indicated by the SQL query?

If anyone has any information on this I would appreciate it. Basically I’m
looking for a condition that only fires once per ticket creation but late
enough in the ticket creation process that all the custom fields have
already been updated by RTIR built-in scrips (ie. ticket already commited
to database?).

Landon Stewart LandonStewart@Gmail.com

yes, use SQL to check:

select Description from Scrips order by Description;

[RTIR] prefix is also accounted, so you have to know where DB places it
while sorting.

Thank you that makes sense. I still have a bit of an issue with the
order of things. If I use “On Create” as the condition the scrip fires
earlier than the order by Description and there are no IP addresses in the
custom field at that point. If I use a User Defined condition the IP
address custom field is already populated by that time. The problem with
using a User Defined condition is that it has the potential to fire more
than once if I base it on something to do with the ticket that might happen
more than once in the ticket’s life. I only want to do this process once
on the original content of the ticket so On Create makes the most sense.

Any idea how I can get a condition that that will only fire once per
ticket on creation or otherwise but going by the order of scrips that
indicated by the SQL query?

If anyone has any information on this I would appreciate it. Basically I’m
looking for a condition that only fires once per ticket creation but late
enough in the ticket creation process that all the custom fields have
already been updated by RTIR built-in scrips (ie. ticket already commited
to database?).

http://requesttracker.wikia.com/wiki/CustomConditionSnippets#When_Custom_Field_.27X.27_is_set_to_.27A.27


Landon Stewart LandonStewart@Gmail.com


RT Training in Seattle, June 19-20: http://bestpractical.com/training

Best regards, Ruslan.