4.3. Finding a Ticket

 < Day Day Up > 

The show action displays a ticket and its metadata, history, and attachments:

     $ rt show ticket/3     id: ticket/3     Queue: General     Owner: darren     Creator: root     Subject: Bring more coffee rolls!     Status: open     Priority: 90     InitialPriority: 0     FinalPriority: 0     Requestors:     Cc:     AdminCc:     Created: Mon May 03 21:18:30 2004     Starts: Mon May 03 21:17:43 2004     Started: Mon May 03 22:20:23 2004     Due: Mon May 03 21:17:43 2004     Resolved: Not set     Told: Not set     TimeEstimated: 0     TimeWorked: 0     TimeLeft: 0 

As you can see, show displays a lot of information by default. To limit the amount of detail returned, pass the -f option to specify the fields you want to see. The field names correspond to what show displays, except they are not case-sensitive. The following example limits the display to ticket ID, queue name, subject, status, and priority:

     $ rt show ticket/3 -f id,queue,subject,status,priority     id: ticket/3     Queue: General     Subject: Bring more coffee rolls!     Status: open     Priority: 90 

By default, show shows the object's metadata. However, there are other object attributes you might want to see, like a ticket's history or attachments. These attributes are addressed using the object specification syntax. To access the history attribute of ticket 9, use ticket/9/history.

     $ rt show ticket/9/history     # 6/6 (/total)           63: Ticket created by jdoe     64: Cc root@localhost added by jdoe     72: Cc root@eruditorum.org added by jdoe     73: Cc root@localhost removed by root     74: Priority changed from 0 to 99 by jdoe     75: Status changed from new to open by jdoe 

You also can display all of the attachments for a ticket with the attachments attribute:

     $ rt show ticket/9/attachments           Attachments: 7:  (multipart/mixed / 0b), 8:  (text/plain / 29b),                  9:  (multipart/mixed / 0b), 10:  (text/plain / 0b),                  11: output.txt (text/plain / 164b),                  12:  (text/plain / 622b) 

To view the plain-text content of one of the attachments, use the content attribute together with the attachments attribute:

     $ rt show ticket/9/attachments/11/content           This is the output I get when I try the first solution:     ... 

Here's a command to look at the information that makes up an RT user, reducing the output by specifying certain fields only:

     $ rt show -t user -f id,name,emailaddress,comments root       

Referring to Objects and Attributes

Many rt operations act on an object, which is designated by a specification. Every object in RT has a type (ticket, queue, or user, for example) and a numeric ID. Some types of objects also can be identified by name (like users and queues). Furthermore, objects may have named attributes, such as history or attachments. An object specification is like a path in a virtual filesystem, with object types as top-level directories, object IDs as subdirectories, and named attributes as further subdirectories. For example, you reference RT's root user as:

     user/root 

A comma-separated list of names, numeric IDs, or numeric ranges can specify more than one object of the same type. Note that the list must be a single argument (i.e., no spaces). For example, to reference the root and aml users by name, and several other users by their numeric ID, you could write:

     user/root,1-3,5,7-10,aml 

The same list also can be written as:

     user/aml,root,1,2,3,5,7,8,9,10 

The same notation extends to attributes.


     id: user/12     Name: root     EmailAddress: root@localhost     Comments: SuperUser 

When looking at several tickets at once, note that you can specify multiple IDs separated by commas, and a range of IDs defined with a dash between the minimum and maximum ID, as in the following example:

     $ rt show ticket/1,5-8,42 -f id,subject,status           id: ticket/1     Subject: a new ticket     Status: new           --           id: ticket/5     Subject: a new ticket     Status: new           --           id: ticket/6     Subject: a new ticket     Status: new           ... 

In addition to the type/id form, you also can specify multiple object IDs at the end of the command, separated by either spaces or commas:

     $ rt show -t ticket -f id,subject,status 1 5-8 42           id: ticket/1     Subject: a new ticket     Status: new           --           id: ticket/5     Subject: a new ticket     Status: new           --           id: ticket/6     Subject: a new ticket     Status: new           --           id: ticket/7     Subject: a new ticket     Status: new           --           id: ticket/8     Subject: a new ticket     Status: new           --           id: ticket/42     Subject: a new ticket     Status: new 

     < Day Day Up > 


    RT Essentials
    RT Essentials
    ISBN: 0596006683
    EAN: 2147483647
    Year: 2005
    Pages: 166

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net