rt_ticket_search: Search for tickets

Description Usage Arguments Details Value Examples

View source: R/rt_ticket_search.R

Description

Search RT for tickets using RT's query syntax which is documented at https://docs.bestpractical.com/rt/4.4.4/query_builder.html.

Usage

1
rt_ticket_search(query, orderby = NULL, format = "l", fields = NULL, ...)

Arguments

query

(character) Your query (See Details)

orderby

(character) How to order your search results. Should be a ticket property name preceded by either a + or a - character.

format

(character) Either i (ticket ID only), s (ticket ID and subject), or l (full ticket metadata). Defaults to l.

fields

(character) Comma-separated list of fields to include in the results.

...

Other arguments passed to rt_GET

Details

The query parameter conforms to RT's query syntax and requires you to build the query yourself. A query will have one or more parameters of the form $FIELD='$VALUE' where $FIELD is an RT ticket property like Subject, Requestor, etc and $VALUE (surrounded by single quotes) is the value to filter by. See Examples for examples.

Value

Either a data.frame or tibble (when format is l or s) or a numeric vector when it's i.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# To return all un-owned tickets on a queue:
rt_ticket_search("Queue='General' AND (Status='new')")

# We can sort by date created, increasing
rt_ticket_search("Queue='General' AND (Status='new')",
                 orderby = "+Created")

# If we just need a vector of ticket ids
rt_ticket_search("Queue='General' AND (Status='new')",
                 orderby = "+Created",
                 format = "i")

## End(Not run)

rt documentation built on May 15, 2021, 9:06 a.m.