Creating Ticket Externally in RT2

Hey All –

We do some wacky things with RT where we’d like to be able to create a
ticket directly in the RT2 database, rather than through e-mail, CLI, or
web interfaces.

Yeah yeah – I know it’s not ‘supported’ or the ‘right way’ to do it, and
I don’t use ‘deodorant,’ etc…

What tables do we need to insert into? I’m thinking Tickets and
Transactions ought to do it; any others? Are there any special gotchas
on field contents in those tables?

Any info appreciated.

Dave

David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net

How directly do you mean? You really really really want to at least use
RT’s API to do it ($Ticket->Create).

Failing that, you need to insert things into at least most of the following tables:

    Tickets
    Transactions
    Attachments
    Watchers
    ObjectKeywordsOn Thu, Aug 02, 2001 at 03:59:15AM -0400, David C. Troy wrote:

Hey All –

We do some wacky things with RT where we’d like to be able to create a
ticket directly in the RT2 database, rather than through e-mail, CLI, or
web interfaces.

Yeah yeah – I know it’s not ‘supported’ or the ‘right way’ to do it, and
I don’t use ‘deodorant,’ etc…

What tables do we need to insert into? I’m thinking Tickets and
Transactions ought to do it; any others? Are there any special gotchas
on field contents in those tables?

Any info appreciated.

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“It’s buried in the desert, got sand in it, melts Nazis. You know,
the Ark of the Covenant” – siva

Yeah, well, pretty directly… Basically I want to create a ticket from an
ASP script talking to MySQL over MyODBC… yeah, I know, the horror… :slight_smile:

I kind of want to know from the database what ticket number I get
assigned, etc… getting perl involved on the Win platform gets way too
silly. I figured if I could write to the tables directly that would be
easiest.

I’m thinking Tickets and Transactions will work as a minimal, barebones
new ticket – I control the content and it’s just piddly text messages, so
there’s not a lot of variability there… Seem OK?

Dave

David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.netOn Thu, 2 Aug 2001, Jesse wrote:

How directly do you mean? You really really really want to at least use
RT’s API to do it ($Ticket->Create).

Failing that, you need to insert things into at least most of the following tables:

    Tickets
    Transactions
    Attachments
    Watchers
    ObjectKeywords

On Thu, Aug 02, 2001 at 03:59:15AM -0400, David C. Troy wrote:

Hey All –

We do some wacky things with RT where we’d like to be able to create a
ticket directly in the RT2 database, rather than through e-mail, CLI, or
web interfaces.

Yeah yeah – I know it’s not ‘supported’ or the ‘right way’ to do it, and
I don’t use ‘deodorant,’ etc…

What tables do we need to insert into? I’m thinking Tickets and
Transactions ought to do it; any others? Are there any special gotchas
on field contents in those tables?

Any info appreciated.

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users


jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“It’s buried in the desert, got sand in it, melts Nazis. You know,
the Ark of the Covenant” – siva

If I were you, I’d have the ASP script do a post to a custom web-create page
and read back the result…it’s better not to let things other than RT get the db in a possibly inconsitent state.On Thu, Aug 02, 2001 at 04:37:35AM -0400, David C. Troy wrote:

Yeah, well, pretty directly… Basically I want to create a ticket from an
ASP script talking to MySQL over MyODBC… yeah, I know, the horror… :slight_smile:

I kind of want to know from the database what ticket number I get
assigned, etc… getting perl involved on the Win platform gets way too
silly. I figured if I could write to the tables directly that would be
easiest.

I’m thinking Tickets and Transactions will work as a minimal, barebones
new ticket – I control the content and it’s just piddly text messages, so
there’s not a lot of variability there… Seem OK?

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net

On Thu, 2 Aug 2001, Jesse wrote:

How directly do you mean? You really really really want to at least use
RT’s API to do it ($Ticket->Create).

Failing that, you need to insert things into at least most of the following tables:

    Tickets
    Transactions
    Attachments
    Watchers
    ObjectKeywords

On Thu, Aug 02, 2001 at 03:59:15AM -0400, David C. Troy wrote:

Hey All –

We do some wacky things with RT where we’d like to be able to create a
ticket directly in the RT2 database, rather than through e-mail, CLI, or
web interfaces.

Yeah yeah – I know it’s not ‘supported’ or the ‘right way’ to do it, and
I don’t use ‘deodorant,’ etc…

What tables do we need to insert into? I’m thinking Tickets and
Transactions ought to do it; any others? Are there any special gotchas
on field contents in those tables?

Any info appreciated.

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users


jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“It’s buried in the desert, got sand in it, melts Nazis. You know,
the Ark of the Covenant” – siva

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

A REAL sysadmin challenge is “resurrect five dead mailserver while so ripped
to the gills on mdma that you can’t focus on any given line of text for more
than 10 seconds continuously.”
-Nathan Mehl

Yeah, you may be right… possibly an XML realtime interface. Thanks for
the input. At least now if I decide to trash the database I know it
wasn’t a good idea. :slight_smile:

Dave

David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.netOn Thu, 2 Aug 2001, Jesse wrote:

If I were you, I’d have the ASP script do a post to a custom web-create page
and read back the result…it’s better not to let things other than RT get the db in a possibly inconsitent state.

On Thu, Aug 02, 2001 at 04:37:35AM -0400, David C. Troy wrote:

Yeah, well, pretty directly… Basically I want to create a ticket from an
ASP script talking to MySQL over MyODBC… yeah, I know, the horror… :slight_smile:

I kind of want to know from the database what ticket number I get
assigned, etc… getting perl involved on the Win platform gets way too
silly. I figured if I could write to the tables directly that would be
easiest.

I’m thinking Tickets and Transactions will work as a minimal, barebones
new ticket – I control the content and it’s just piddly text messages, so
there’s not a lot of variability there… Seem OK?

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net

On Thu, 2 Aug 2001, Jesse wrote:

How directly do you mean? You really really really want to at least use
RT’s API to do it ($Ticket->Create).

Failing that, you need to insert things into at least most of the following tables:

    Tickets
    Transactions
    Attachments
    Watchers
    ObjectKeywords

On Thu, Aug 02, 2001 at 03:59:15AM -0400, David C. Troy wrote:

Hey All –

We do some wacky things with RT where we’d like to be able to create a
ticket directly in the RT2 database, rather than through e-mail, CLI, or
web interfaces.

Yeah yeah – I know it’s not ‘supported’ or the ‘right way’ to do it, and
I don’t use ‘deodorant,’ etc…

What tables do we need to insert into? I’m thinking Tickets and
Transactions ought to do it; any others? Are there any special gotchas
on field contents in those tables?

Any info appreciated.

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users


jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“It’s buried in the desert, got sand in it, melts Nazis. You know,
the Ark of the Covenant” – siva


jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

A REAL sysadmin challenge is “resurrect five dead mailserver while so ripped
to the gills on mdma that you can’t focus on any given line of text for more
than 10 seconds continuously.”
-Nathan Mehl

And then I’ll have them out of the way for a couple weeks… :slight_smile:

I want to customize the look of the Web UI a bit… ‘Ticket History’ sure
is big, for example.

Where do I do this? Apologies if this is an RTFM… I am R’ing the F’ing
M as we speak but don’t see it.

Dave

David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.netOn Thu, 2 Aug 2001, David C. Troy wrote:

Yeah, well, pretty directly… Basically I want to create a ticket from an
ASP script talking to MySQL over MyODBC… yeah, I know, the horror… :slight_smile:

I kind of want to know from the database what ticket number I get
assigned, etc… getting perl involved on the Win platform gets way too
silly. I figured if I could write to the tables directly that would be
easiest.

I’m thinking Tickets and Transactions will work as a minimal, barebones
new ticket – I control the content and it’s just piddly text messages, so
there’s not a lot of variability there… Seem OK?

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net

On Thu, 2 Aug 2001, Jesse wrote:

How directly do you mean? You really really really want to at least use
RT’s API to do it ($Ticket->Create).

Failing that, you need to insert things into at least most of the following tables:

    Tickets
    Transactions
    Attachments
    Watchers
    ObjectKeywords

On Thu, Aug 02, 2001 at 03:59:15AM -0400, David C. Troy wrote:

Hey All –

We do some wacky things with RT where we’d like to be able to create a
ticket directly in the RT2 database, rather than through e-mail, CLI, or
web interfaces.

Yeah yeah – I know it’s not ‘supported’ or the ‘right way’ to do it, and
I don’t use ‘deodorant,’ etc…

What tables do we need to insert into? I’m thinking Tickets and
Transactions ought to do it; any others? Are there any special gotchas
on field contents in those tables?

Any info appreciated.

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users


jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“It’s buried in the desert, got sand in it, melts Nazis. You know,
the Ark of the Covenant” – siva

For rt1, I did a similar thing, so that people could fill in a form, hit submit, and be given a ticket number, without ever actually seeing RT.
I wrote an expect/tcl script to interact with the CLI for this - It meant I could stay away from the horrid perl, but still have RT trigger things as it should.On Thu, 2 Aug 2001 05:00:40 -0400 (EDT) “David C. Troy” dave@toad.net wrote:

Yeah, you may be right… possibly an XML realtime interface. Thanks for
the input. At least now if I decide to trash the database I know it
wasn’t a good idea. :slight_smile:

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net

On Thu, 2 Aug 2001, Jesse wrote:

If I were you, I’d have the ASP script do a post to a custom web-create page
and read back the result…it’s better not to let things other than RT get the db in a possibly inconsitent state.

On Thu, Aug 02, 2001 at 04:37:35AM -0400, David C. Troy wrote:

Yeah, well, pretty directly… Basically I want to create a ticket from an
ASP script talking to MySQL over MyODBC… yeah, I know, the horror… :slight_smile:

I kind of want to know from the database what ticket number I get
assigned, etc… getting perl involved on the Win platform gets way too
silly. I figured if I could write to the tables directly that would be
easiest.

I’m thinking Tickets and Transactions will work as a minimal, barebones
new ticket – I control the content and it’s just piddly text messages, so
there’s not a lot of variability there… Seem OK?

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net

On Thu, 2 Aug 2001, Jesse wrote:

How directly do you mean? You really really really want to at least use
RT’s API to do it ($Ticket->Create).

Failing that, you need to insert things into at least most of the following tables:

    Tickets
    Transactions
    Attachments
    Watchers
    ObjectKeywords

On Thu, Aug 02, 2001 at 03:59:15AM -0400, David C. Troy wrote:

Hey All –

We do some wacky things with RT where we’d like to be able to create a
ticket directly in the RT2 database, rather than through e-mail, CLI, or
web interfaces.

Yeah yeah – I know it’s not ‘supported’ or the ‘right way’ to do it, and
I don’t use ‘deodorant,’ etc…

What tables do we need to insert into? I’m thinking Tickets and
Transactions ought to do it; any others? Are there any special gotchas
on field contents in those tables?

Any info appreciated.

Dave

=====================================================================
David C. Troy [dave@toad.net] 410-544-6193 Sales
ToadNet - Want to go fast? 410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925 www.toad.net


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users


jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“It’s buried in the desert, got sand in it, melts Nazis. You know,
the Ark of the Covenant” – siva


jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

A REAL sysadmin challenge is “resurrect five dead mailserver while so ripped
to the gills on mdma that you can’t focus on any given line of text for more
than 10 seconds continuously.”
-Nathan Mehl


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Feargal Reilly,
Systems Administrator,
The CIA.

If I were you, I’d have the ASP script do a post to a custom
web-create page and read back the result…it’s better not to let
things other than RT get the db in a possibly inconsitent state.

How often does RT leave the db in a possibly inconsistent state? :stuck_out_tongue:

Sheeri Kritzer
Systems Administrator
University Systems Group
Tufts University
617-627-3925
skritz01@emerald.tufts.edu

I want to customize the look of the Web UI a bit… ‘Ticket History’ sure
is big, for example.

Dave, I see your dumb question and raise you another.

Any way to customize Ticket History so the most recent comments are on the
top instead of the bottom?

Sheeri Kritzer
Systems Administrator
University Systems Group
Tufts University
617-627-3925
skritz01@emerald.tufts.edu

Any way to customize Ticket History so the most recent comments are on the
top instead of the bottom?

you should be able to edit rt2/lib/RT/Transactions.pm - look for the line
Order => ‘ASC’
and change it to Order => ‘DESC’

That’ll do it.

Sheeri Kritzer
Systems Administrator
University Systems Group
Tufts University
617-627-3925
skritz01@emerald.tufts.edu


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Feargal Reilly,
Systems Administrator,
The CIA.

On the file “ShowHistory” you should have a INIT section.
On it, the following line:

my $Transactions = $Ticket->Transactions;

Add the following code just after that line:

$Transactions->OrderBy( ALIAS => ‘main’,
FIELD => ‘Created’,
ORDER => ‘DESC’);

It should work.
I didn’t test it, but this work with another element I’ve wrote. This
element show a “Reverse history summary” just before the history, with
one line per transaction, and with an hyperlink to the transaction
details in the detailed history. So, just looking at this summary, you
know who did what. Just click on a link and you go to the details.
See the attachement to see it if you want.

If you also want this element, let me know.

Rafael-----Original Message-----
From: Sheeri Kritzer [mailto:skritz01@emerald.tufts.edu]
Sent: jeudi, 2. août 2001 16:37
To: rt-users@lists.fsck.com
Subject: Re: [rt-users] One more dumb question…

On Thu, 2 Aug 2001, David C. Troy wrote:

I want to customize the look of the Web UI a bit… ‘Ticket History’
sure is big, for example.

Dave, I see your dumb question and raise you another.

Any way to customize Ticket History so the most recent comments are on
the
top instead of the bottom?

Sheeri Kritzer
Systems Administrator
University Systems Group
Tufts University
617-627-3925
skritz01@emerald.tufts.edu

rt-users mailing list
rt-users@lists.fsck.com http://lists.fsck.com/mailman/listinfo/rt-users