Create ticket with CLI

How I can create a ticket with CLI?
I Am successful to visualize a ticket and to make a search, but also with the examples I do not succeed to create nothing.
Someone can help me?
Thanks!
Sorry for my English

Alfonso Focareta
Pro-Netics s.r.l.

At 2003-10-09 00:06:46 +0200, a.focareta@pro-netics.com wrote:

How I can create a ticket with CLI?

  1. “rt create -t ticket” should open $EDITOR with a form that you can
    fill in and submit (i.e., save and exit).

  2. “rt create -t ticket set subject=… priority=…” will create a
    ticket without the form (of course, you can set other fields too).

Here’s a patch to add these examples to “rt help create”.

– ams

— bin/rt.in~ Thu Oct 9 07:39:37 2003
+++ bin/rt.in Thu Oct 9 07:42:07 2003
@@ -1611,10 +1611,17 @@

 Examples:
  •    # Interactive (starts $EDITOR with a form).
    
  •    rt edit ticket/3
    
  •    rt create -t ticket
    
  •    # Non-interactive.
       rt edit ticket/1-3 add cc=foo@example.com set priority=3
       rt ls -t tickets -i 'Priority > 5' | rt edit - set status=resolved
       rt edit ticket/4 set priority=3 owner=bar@example.com \
                        add cc=foo@example.com bcc=quux@example.net
    
  •    rt create -t ticket subject='new ticket' priority=10 \
    
  •                        add cc=foo@example.com
    

Just a warning about this: when creating a new ticket, the CLI will
first create an empty ticket in the default queue (“General”) and then
only sets up its values (queue, requestor, owner, subject, and whatever
you submitted). This will create as many transactions as there are
parameters to set.

And because of the empty creation, if you have a script that sends admin
notification on ticket creation (as shipped by default), admins will
receive a bogus mail.

Guillaume Perréal.

Responsable informatique,
Cemagref, groupement de Lyon,
France.

Tél: (+33) 4.72.20.87.87.
Fax: (+33) 4.78.47.78.75.
Site: http://www.lyon.cemagref.fr/

How I can create a ticket with CLI?
I Am successful to visualize a ticket and to make a search, but also with the examples I do not succeed to create nothing.
Someone can help me?
Thanks!
Sorry for my English

Alfonso Focareta
Pro-Netics s.r.l.

I have rt 3.0.6 version but when i try to crate a ticket with that sintax
rt create -t ticket set subject=‘The subject’ priority=50 owner=‘afocareta’
queue=‘Ez’
the response is

Unknown object type: edit

priority: 50
owner: afocareta
subject: The subject
id: ticket/new
queue: Ez

where mistake?
tnx!!----- Original Message -----
From: “Dan Fulbright” lists.fsck.com@okra.org
To: “Alfonso Focareta” a.focareta@pro-netics.com
Sent: Friday, October 10, 2003 6:10 PM
Subject: Re: [rt-users] Create ticket with CLI

How I can create a ticket with CLI?

You didn’t tell us which version of RT you are using. I believe the CLI
was pretty much broken until 3.0.6.

RT2:
rt --create --subject=‘The subject’ --priority=50 --owner=ownername
–queue=queuename --comment --source
/path/to/a/text/file
–noedit --requestor=‘requestor@domain.com’

RT3:
rt create -t ticket set subject=‘The subject’ priority=50
owner=ownername queue=queuename
requestors=‘requestor@domain.com’

I haven’t yet figured out a way to put a comment in a ticket on creation
with the CLI.