[rt-devel] FW: External Synchronization
Steven Velez
svelez at ironcad.com
Mon Nov 10 08:26:43 EST 2003
Developers,
I did not get any response from the attached message on the users list,
so I am forwarding to the developers in the hopes that I may get some
feedback. To summarize, I am writing a connection between RT and an
external issue management system which we can not yet abandon for legacy
reasons.
So, I was thinking that I would write a scrip that always runs and
manages synchronizing the external database and RT. My problem lies in
the fact that transactions in the external database and RT are not
semantically equivalent. While RT considers each modification of a
field a transaction (independent of all other modifications and
transactions), my external database lumps all related edits to a
ticket/incident in to a transaction.
I would like to retain this association from RT in that one form
submission, command-line invocation, or e-mail only updates each
external ticket once. I have not determined how to make a scrip action
occur to meet these conditions, and after spending some time looking at
the code, I don't feel like this is possible without modifying the code.
I am aware that currently, each scrip is loaded and executed (provided
it meets conditions) when a transaction is created, transactions are in
turn created whenever something about the ticket changes. I guess my
problem is that the transactions know nothing about the context that
they are executing in or how they relate to other transactions.
If there is no way to do this with the existing code, I am willing to
add a mechanism for this, but I want to be sure that whatever I do meets
the goals of the project and fits in to the existing vision. For
example each generic scrip condition (RT::Condition::Generic) has
Argument and Type fields which are currently not set. What is the
intention of these and may I enhance these to get the leverage I need?
Any feedback and help would be greatly appreciated.
Thanks,
Steven
-----Original Message-----
From: Steven Velez
Sent: Thursday, November 06, 2003 8:34 AM
To: 'rt-users at lists.fsck.com'
Subject: External Synchronization
Hi All,
For various reasons beyond the scope of this e-mail I need to keep an
external database in sync with tickets maintained in my RT installation.
I plan on doing with a scrip, but I don't see how I may do one thing.
I need a condition that will cause the scrip to be executed whenever
anything at all is updated. However, the obvious condition (return 1;)
gets executed more often than I would like... it happens once per field
that is updated. What I would like is for my script to run once per
ticket per user action, be that submitting a web form or invoking the
cli. I took some time to look at the RT code to see how it calls scrips
and it seems that something like this, if it is possible, is not easy.
Even if I were to modify RT to give some information on this in the
argument property of the ScripCondition, I would not know which update
was the last one and providing that information would be hard in all the
code paths (I think).
So, right now I'm probing for ideas. I don't want to do an update of the
external data at the RT transaction granularity because the external
system transaction semantics are not really equivalent.
Thanks in advanced.
Steven
More information about the Rt-devel
mailing list