rt (version 1.0.1)

rt_ticket_search: Search for tickets

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

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

Value

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

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.

Examples

Run this code
# 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")
# }

Run the code above in your browser using DataLab