Mojo for Callback placement?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I use RTCRON to escalate the priority of tickets. A nasty byproduct of
this package is a long list of transactions in a given ticket’s history.
I want to eliminate “Set” “Priority” transactions from a ticket’s
history when displaying the ticket.

I found the file where the history is created:

/opt/rt3/share/html/Ticket/Elements/ShowHistory

and within that file found the appropriate area with a callback:

while ( my $Transaction = $Transactions->Next ) {
my $skip = 0;
$m->comp( ‘/Elements/Callback’,
_CallbackName => ‘SkipTransaction’,
Transaction => $Transaction,
skip => $skip,
%ARGS );
next if $skip;
$i++;

So what I want is to create a callback that returns a “0” if the
transaction is to be displayed, or a “1” if it is to be skipped. (I’m
essentially wanting to rid myself of “Set” “Priority” transactions from
the output.

Now here is the part I’m finding difficult to grok… given the path
shown above, where do I create the code for the callback? I assume that
the end of the path would be:

[something here]…/Ticket/Elements/ShowHistory/SkipTransaction

but I’m unclear what the first part of that path is.

While the “RT Essentials” book has been an extraordinary resource for
working with RT, it doesn’t seem to cover Callbacks at all. The wiki
offers some suggestions but I’m still unclear. I’ve tried a couple of
different locations but I’m shooting in the dark, without success.

To sum this all up, what would the fully qualified name of the file
containing the callback code be?

Thanks very much in advance for your help.

Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFFLPccCFu3bIiwtTARAqAYAKCODbBBoy80E/6VwVQLYB19efzqKACbBe0v
7kWDkj3/zVh77+c4/cuKtC0=
=TyYG
-----END PGP SIGNATURE-----

So what I want is to create a callback that returns a “0” if the
transaction is to be displayed, or a “1” if it is to be skipped. (I’m
essentially wanting to rid myself of “Set” “Priority” transactions from
the output.

Now here is the part I’m finding difficult to grok… given the path
shown above, where do I create the code for the callback? I assume that
the end of the path would be:

[something here]…/Ticket/Elements/ShowHistory/SkipTransaction

but I’m unclear what the first part of that path is.

Grab a copy of RTIR 2.0. It should have a callback that does this to
learn from.

-j

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I use RTCRON to escalate the priority of tickets. A nasty byproduct of
this package is a long list of transactions in a given ticket’s history.
I want to eliminate “Set” “Priority” transactions from a ticket’s
history when displaying the ticket.

I found the file where the history is created:

/opt/rt3/share/html/Ticket/Elements/ShowHistory

and within that file found the appropriate area with a callback:

while ( my $Transaction = $Transactions->Next ) {
my $skip = 0;
$m->comp( ‘/Elements/Callback’,
_CallbackName => ‘SkipTransaction’,
Transaction => $Transaction,
skip => $skip,
%ARGS );
next if $skip;
$i++;

So what I want is to create a callback that returns a “0” if the
transaction is to be displayed, or a “1” if it is to be skipped. (I’m
essentially wanting to rid myself of “Set” “Priority” transactions from
the output.

Now here is the part I’m finding difficult to grok… given the path
shown above, where do I create the code for the callback? I assume that
the end of the path would be:

$ mkdir -p /opt/rt3/local/html/Callbacks/MyCallbacks/Ticket/Elements/ShowHistory
$ vi /opt/rt3/local/html/Callbacks/MyCallbacks/Ticket/Elements/ShowHistory/SkipTransaction

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jesse Vincent wrote:

Grab a copy of RTIR 2.0. It should have a callback that does this to
learn from.

Hi Jesse.

I can’t seem to find 2.0 on the site. The newest that I could find was

rtir-20060309

which contains RTIR 1.9.

Checking down through I could only find one “Callbacks” directory which
contained a one-liner.

Did I overlook the link on the site or do I need to obtain it with CVS
or SVN?

Thanks

Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFFLVV5CFu3bIiwtTARAn1fAJ9JtHn8o72+ePVNlVZRB3lt91W6HACeN6ZA
3fc7jBkaAjCswCHCfZ+1ObQ=
=Xpnf
-----END PGP SIGNATURE-----

Barry, RT Fans–

While I’m not a user of RTIR, it looks like there is a 2.0-TESTING branch
in BP’s SVN:
[spaceball1:jdiegmueller] [/tmp] # svn ls svn://svn.bestpractical.com/rtir/branches
1.1-TESTING/
1.9-EXPERIMENTAL/
2.0-TESTING/
2.1-EXPERIMENTAL/

Hope this is it. :slight_smile:

Good luck,
-jdOn Wed, 11 Oct 2006, Barry L. Kline wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jesse Vincent wrote:

Grab a copy of RTIR 2.0. It should have a callback that does this to
learn from.

Hi Jesse.

I can’t seem to find 2.0 on the site. The newest that I could find was

rtir-20060309

which contains RTIR 1.9.

Checking down through I could only find one “Callbacks” directory which
contained a one-liner.

Did I overlook the link on the site or do I need to obtain it with CVS
or SVN?

Thanks

Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFFLVV5CFu3bIiwtTARAn1fAJ9JtHn8o72+ePVNlVZRB3lt91W6HACeN6ZA
3fc7jBkaAjCswCHCfZ+1ObQ=
=Xpnf
-----END PGP SIGNATURE-----


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason A. Diegmueller wrote:

Barry, RT Fans–

While I’m not a user of RTIR, it looks like there is a 2.0-TESTING
branch in BP’s SVN:
[spaceball1:jdiegmueller] [/tmp] # svn ls
svn://svn.bestpractical.com/rtir/branches
1.1-TESTING/
1.9-EXPERIMENTAL/ 2.0-TESTING/
2.1-EXPERIMENTAL/

Hope this is it. :slight_smile:

JD…

Thanks very much. 2.0 was in there and it was exactly what I needed.

Jesse…

Thank you very much. The callbacks that are included with that
are going to be great for learning how to create not only what I wanted
to accomplish immediately but will be great for later uses, too.

I recommend that anyone wanting to learn how to write callbacks pull
this information down.

Thanks again guys!

Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFFLbbmCFu3bIiwtTARAiQ2AJ9u14DRqR+UvJTfKX1SLNXgnYU9xACeLxiS
8EP2RfKnZioQ4hj0jLmp5Ao=
=X1an
-----END PGP SIGNATURE-----

Yeah, RTIR is great example of how to build completely customized
workflow over RT. With many scrips, callbacks and custom access
interface.On 10/12/06, Barry L. Kline blkline@attglobal.net wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason A. Diegmueller wrote:

Barry, RT Fans–

While I’m not a user of RTIR, it looks like there is a 2.0-TESTING
branch in BP’s SVN:
[spaceball1:jdiegmueller] [/tmp] # svn ls
svn://svn.bestpractical.com/rtir/branches
1.1-TESTING/
1.9-EXPERIMENTAL/ 2.0-TESTING/
2.1-EXPERIMENTAL/

Hope this is it. :slight_smile:

JD…

Thanks very much. 2.0 was in there and it was exactly what I needed.

Jesse…

Thank you very much. The callbacks that are included with that
are going to be great for learning how to create not only what I wanted
to accomplish immediately but will be great for later uses, too.

I recommend that anyone wanting to learn how to write callbacks pull
this information down.

Thanks again guys!

Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFFLbbmCFu3bIiwtTARAiQ2AJ9u14DRqR+UvJTfKX1SLNXgnYU9xACeLxiS
8EP2RfKnZioQ4hj0jLmp5Ao=
=X1an
-----END PGP SIGNATURE-----


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.