How to pre-fill fields?

How do I pre-fill a field(e.g. the subject fill or description field). .i.e how do I modify RT so that when I click ‘new ticket’ the subject or description fill would already have text that I entered somewhere else?

I have a simple php page I use for my users to submit tickets that utilizes the commandbyemail plugin to set fields like subject, duedate, priority and to add an admincc. I am not near my office network, but if you’re interested, I can post the page code or upload it. It supports attachments as well, but I limit them to 2MB within the php code (which can be changed).

Let me know if there is interest.

Joe-----Original Message-----
From: Jason Edgar superjuke@gmail.com
Sender: rt-users-bounces@lists.bestpractical.com
Date: Sat, 16 Oct 2010 18:14:30
To: rt-users@lists.bestpractical.com
Reply-To: superjuke@gmail.com
Subject: [rt-users] how to pre-fill fields?

How do I pre-fill a field(e.g. the subject fill or description field). .i.e how do I modify RT so that when I click ‘new ticket’ the subject or description fill would already have text that I entered somewhere else?

RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year – Learn how to get the most out of RT!

I would be interested in seeing your solution, though I don’t know if I’d be able to use it. Can’t I prefill the fields with a scrip?On Sat, 16 Oct 2010 23:27:26 +0000, Joe Harris wrote:

I have a simple php page I use for my users to submit tickets that
utilizes the commandbyemail plugin to set fields like subject,
duedate, priority and to add an admincc. I am not near my office
network, but if you’re interested, I can post the page code or
upload it. It supports attachments as well, but I limit them to 2MB
within the php code (which can be changed).

Let me know if there is interest.

Joe

Sent from blackberry

-----Original Message-----
From: Jason Edgar superjuke@gmail.com
Sender: rt-users-bounces@lists.bestpractical.com
Date: Sat, 16 Oct 2010 18:14:30
To: rt-users@lists.bestpractical.com
Reply-To: superjuke@gmail.com
Subject: [rt-users] how to pre-fill fields?

How do I pre-fill a field(e.g. the subject fill or description
field). .i.e how do I modify RT so that when I click ‘new ticket’
the subject or description fill would already have text that I
entered somewhere else?

RT Training in Washington DC, USA on Oct 25 & 26 2010 Last one this
year – Learn how to get the most out of RT!

If you’re coming from another page, you can post the value of the fields you
want. Look at share/html/Ticket/Create for the variable names.

If you want to put default values, create a callback for Ticket/Create that
would fill the required fields.

Mathieu Longtin
1-514-803-8977On Sat, Oct 16, 2010 at 7:50 PM, Jason Edgar superjuke@gmail.com wrote:

I would be interested in seeing your solution, though I don’t know if I’d
be able to use it. Can’t I prefill the fields with a scrip?

On Sat, 16 Oct 2010 23:27:26 +0000, Joe Harris wrote:

I have a simple php page I use for my users to submit tickets that
utilizes the commandbyemail plugin to set fields like subject,
duedate, priority and to add an admincc. I am not near my office
network, but if you’re interested, I can post the page code or
upload it. It supports attachments as well, but I limit them to 2MB
within the php code (which can be changed).

Let me know if there is interest.

Joe

Sent from blackberry

-----Original Message-----
From: Jason Edgar superjuke@gmail.com
Sender: rt-users-bounces@lists.bestpractical.com
Date: Sat, 16 Oct 2010 18:14:30
To: rt-users@lists.bestpractical.com
Reply-To: superjuke@gmail.com
Subject: [rt-users] how to pre-fill fields?

How do I pre-fill a field(e.g. the subject fill or description
field). .i.e how do I modify RT so that when I click ‘new ticket’
the subject or description fill would already have text that I
entered somewhere else?

RT Training in Washington DC, USA on Oct 25 & 26 2010 Last one this
year – Learn how to get the most out of RT!

RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year – Learn how to get the most out of RT!

Thanks Mathieu. I am particularly interested in the CallBack method you mention but I am not a Perl programmer.
Can you give an example to show how I can e.g. set the subject field to “Hello World”?On Sat, 16 Oct 2010 22:59:48 -0400, Mathieu Longtin wrote:

If you’re coming from another page, you can post the value of the
fields you want. Look at share/html/Ticket/Create for the variable
names.

If you want to put default values, create a callback for
Ticket/Create that would fill the required fields.


Mathieu Longtin
1-514-803-8977

On Sat, Oct 16, 2010 at 7:50 PM, Jason Edgar superjuke@gmail.com wrote:

I would be interested in seeing your solution, though I don’t
know if I’d be able to use it. Can’t I prefill the fields with a
scrip?


On Sat, 16 Oct 2010 23:27:26 +0000, Joe Harris wrote: I have a
simple php page I use for my users to submit tickets that
utilizes the commandbyemail plugin to set fields like subject,
duedate, priority and to add an admincc. I am not near my office
network, but if you’re interested, I can post the page code or
upload it. It supports attachments as well, but I limit them to
2MB within the php code (which can be changed).

Let me know if there is interest.

Joe

Sent from blackberry

-----Original Message-----
From: Jason Edgar superjuke@gmail.com
Sender: rt-users-bounces@lists.bestpractical.com Date: Sat, 16
Oct 2010 18:14:30 To: rt-users@lists.bestpractical.com Reply-
To: superjuke@gmail.com Subject: [rt-users] how to pre-fill
fields?

How do I pre-fill a field(e.g. the subject fill or description
field). .i.e how do I modify RT so that when I click ‘new ticket’
the subject or description fill would already have text that I
entered somewhere else?

RT Training in Washington DC, USA on Oct 25 & 26 2010 Last one
this year – Learn how to get the most out of RT!

RT Training in Washington DC, USA on Oct 25 & 26 2010 Last one this
year – Learn how to get the most out of RT!

This is a simple example, you will need some perl code. This sets the
subject and the requestor, unless they are already set. You could set other
fields as well.

Put this in the file local/html/Callbacks/Ticket/Create.html/Default of you
RT installation. Create the directory path if needed.

<%INIT>
my $ARGSRef = $ARGS{‘ARGSRef’};
if ( not $ARGSRef{‘id’} ) { # Check if the ticket is really empty before
doing anything
$ARGSRef{‘Subject’} ||= ‘Default subject’;
$ARGSRef{‘Requestor’} ||= ‘mydefault@requestor.com’;
}
</%INIT>
<%ARGS>
</%ARGS>

Mathieu Longtin
1-514-803-8977On Sun, Oct 17, 2010 at 9:55 AM, Jason Edgar superjuke@gmail.com wrote:

Thanks Mathieu. I am particularly interested in the CallBack method you
mention but I am not a Perl programmer.
Can you give an example to show how I can e.g. set the subject field to
“Hello World”?


On Sat, 16 Oct 2010 22:59:48 -0400, Mathieu Longtin wrote:

If you’re coming from another page, you can post the value of the
fields you want. Look at share/html/Ticket/Create for the variable
names.

If you want to put default values, create a callback for
Ticket/Create that would fill the required fields.


Mathieu Longtin
1-514-803-8977

On Sat, Oct 16, 2010 at 7:50 PM, Jason Edgar superjuke@gmail.com wrote:

I would be interested in seeing your solution, though I don’t
know if I’d be able to use it. Can’t I prefill the fields with a
scrip?


On Sat, 16 Oct 2010 23:27:26 +0000, Joe Harris wrote: I have a
simple php page I use for my users to submit tickets that
utilizes the commandbyemail plugin to set fields like subject,
duedate, priority and to add an admincc. I am not near my office
network, but if you’re interested, I can post the page code or
upload it. It supports attachments as well, but I limit them to
2MB within the php code (which can be changed).

Let me know if there is interest.

Joe

Sent from blackberry

-----Original Message-----
From: Jason Edgar superjuke@gmail.com
Sender: rt-users-bounces@lists.bestpractical.com Date: Sat, 16
Oct 2010 18:14:30 To: rt-users@lists.bestpractical.com Reply-
To: superjuke@gmail.com Subject: [rt-users] how to pre-fill
fields?

How do I pre-fill a field(e.g. the subject fill or description
field). .i.e how do I modify RT so that when I click ‘new ticket’
the subject or description fill would already have text that I
entered somewhere else?

RT Training in Washington DC, USA on Oct 25 & 26 2010 Last one
this year – Learn how to get the most out of RT!

RT Training in Washington DC, USA on Oct 25 & 26 2010 Last one this
year – Learn how to get the most out of RT!

You can also use variables in the URL to the Create.html page. For example rt/Create.html?Queue=3&Requestors=someone@somecompany.com&Subject=Somesubjectmailto:rt/Create.html?Queue=3&Requestors=someone@somecompany.com&Subject=Somesubject

We use this to create links on our wiki to create new tickets for specific customers.
But now I see that the Subject might cause a problem, I don’t know how to specify it if it contains spaces…

/JohanFrom: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Mathieu Longtin
Sent: den 17 oktober 2010 05:00
To: superjuke@gmail.com
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] how to pre-fill fields?

If you’re coming from another page, you can post the value of the fields you want. Look at share/html/Ticket/Create for the variable names.

If you want to put default values, create a callback for Ticket/Create that would fill the required fields.

Mathieu Longtin
1-514-803-8977

I would be interested in seeing your solution, though I don’t know if I’d be able to use it. Can’t I prefill the fields with a scrip?

Thanks Mathieu. I needed to create a directory between Callbacks and Ticket to invoke the Callback when creating a new ticket.
e.g. local/html/Callbacks/MyCallbacks/Ticket/Create.html/Default
But I am getting the following error:

Error during compilation of /opt/rt3/local/html/Callbacks/MyCallbacks/Ticket/Create.html/Default: Global symbol “%ARGSRef” requires explicit package name at /opt/rt3/local/html/Callbacks/MyCallbacks/Ticket/Create.html/Default line 3. Global symbol “%ARGSRef” requires explicit package name at /opt/rt3/local/html/Callbacks/MyCallbacks/Ticket/Create.html/Default line 4. Global symbol “%ARGSRef” requires explicit package name at /opt/rt3/local/html/Callbacks/MyCallbacks/Ticket/Create.html/Default line 5.

Can you please help. Also, what is the ARGSRef for the description text-area field?On Sun, 17 Oct 2010 11:35:08 -0400, Mathieu Longtin wrote:

This is a simple example, you will need some perl code. This sets
the subject and the requestor, unless they are already set. You
could set other fields as well.

Put this in the file
local/html/Callbacks/Ticket/Create.html/Default of you RT
installation. Create the directory path if needed.

<%INIT>
my $ARGSRef = $ARGS{‘ARGSRef’};
if ( not $ARGSRef{‘id’} ) { # Check if the ticket is really empty
before doing anything $ARGSRef{‘Subject’} ||= ‘Default subject’;

$ARGSRef{‘Requestor’} ||= ‘mydefault@requestor.com’; } </%INIT>
<%ARGS> </%ARGS>


Mathieu Longtin
1-514-803-8977

On Sun, Oct 17, 2010 at 9:55 AM, Jason Edgar superjuke@gmail.com wrote:

Thanks Mathieu. I am particularly interested in the CallBack
method you mention but I am not a Perl programmer.
Can you give an example to show how I can e.g. set the subject
field to “Hello World”? ___________________________________

On Sat, 16 Oct 2010 22:59:48 -0400, Mathieu Longtin wrote:

If you’re coming from another page, you can post the value of the
fields you want. Look at share/html/Ticket/Create for the
variable names.

If you want to put default values, create a callback for
Ticket/Create that would fill the required fields.


Mathieu Longtin
1-514-803-8977

On Sat, Oct 16, 2010 at 7:50 PM, Jason Edgar superjuke@gmail.com wrote:

I would be interested in seeing your solution, though I don’t
know if I’d be able to use it. Can’t I prefill the fields with
a scrip?


On Sat, 16 Oct 2010 23:27:26 +0000, Joe Harris wrote: I have a
simple php page I use for my users to submit tickets that
utilizes the commandbyemail plugin to set fields like subject,
duedate, priority and to add an admincc. I am not near my
office network, but if you’re interested, I can post the page
code or upload it. It supports attachments as well, but I limit
them to 2MB within the php code (which can be changed).

Let me know if there is interest.

Joe

Sent from blackberry

-----Original Message-----
From: Jason Edgar superjuke@gmail.com
Sender: rt-users-bounces@lists.bestpractical.com Date: Sat, 16
Oct 2010 18:14:30 To: rt-users@lists.bestpractical.com Reply-
To: superjuke@gmail.com Subject: [rt-users] how to pre-fill
fields?

How do I pre-fill a field(e.g. the subject fill or description
field). .i.e how do I modify RT so that when I click ‘new
ticket’ the subject or description fill would already have text
that I entered somewhere else?

RT Training in Washington DC, USA on Oct 25 & 26 2010 Last one
this year – Learn how to get the most out of RT!

RT Training in Washington DC, USA on Oct 25 & 26 2010 Last one
this year – Learn how to get the most out of RT!

Thanks Mathieu: I got it. An extra $ was needed before ARGSRef from line 3. I have no idea what it is for, I followed other examples from the Internet.
Also the description field is called ‘content’. Thanks again.On Sun, 17 Oct 2010 11:35:08 -0400, Mathieu Longtin wrote:

<%INIT>
my $ARGSRef = $ARGS{‘ARGSRef’};
if ( not $ARGSRef{‘id’} ) { # Check if the ticket is really empty
before doing anything $ARGSRef{‘Subject’} ||= ‘Default subject’;
$ARGSRef{‘Requestor’} ||= ‘mydefault@requestor.com’; } </%INIT>
<%ARGS> </%ARGS>

My bad, all access to ARGSRef need to be like this:

$ARGSRef->{‘id’}
$ARGSRef->{‘Subject’}

With the ->.

Mathieu Longtin
1-514-803-8977On Sun, Oct 17, 2010 at 8:48 PM, Jason Edgar superjuke@gmail.com wrote:

Thanks Mathieu: I got it. An extra $ was needed before ARGSRef from line 3.
I have no idea what it is for, I followed other examples from the Internet.
Also the description field is called ‘content’. Thanks again.

On Sun, 17 Oct 2010 11:35:08 -0400, Mathieu Longtin wrote:

<%INIT>
my $ARGSRef = $ARGS{‘ARGSRef’};
if ( not $ARGSRef{‘id’} ) { # Check if the ticket is really empty
before doing anything $ARGSRef{‘Subject’} ||= ‘Default subject’;
$ARGSRef{‘Requestor’} ||= ‘mydefault@requestor.com’; } </%INIT>
<%ARGS> </%ARGS>