Tickets

Tickets are used to power a “Help Me” action in your app. The user can request help and fill in a question, and the app sends a message to RevTwo that creates a ticket. Depending on the configuration, a ticket may flow into a system like ServiceNow or other CRM. When it is created, a support tech can be claim the ticket and begin to assist the mobile user.

RevTwo offers two different ways to create a ticket.  The first is a view called R2MyTicketViewController.  This view is included in the library and contains the full ticketing workflow.  There is also an API to programmatically create a ticket, such as when some condition occurs or from a custom form.

R2MyTicketViewController

This view can be used as-is, or subclassed in your app.  It manages the workflow around creating and closing tickets. When it is opened, the user can ask a question in the text input and tap submit. This creates a new ticket. The view also shows previous tickets, both open and closed. In this view, tapping on any existing tickets goes to a view with that ticket’s information at the top and in a drop down, including a button to close an open ticket. The main part of the view is where messages are shown, between support techs, other community users, and the app user.

The R2MyTicketViewController is a subclass of UIViewController. It has additional views to interact with an individual ticket. Because the additional views are pushed on a navigation controller, this view needs one. If your app has a navigation controller, then push this view onto it. If not, see the sample app for an example of how to create a navigation controller and present that.

Objective-C

#import "R2MyTicketViewController.h"
...
R2MyTicketViewController *vc = [[R2MyTicketViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];

Swift

let vc = R2MyTicketViewController()
self.navigationController?.pushViewController(vc, animated: true)

R2MyTicketViewController has variables to override the text of anything visible in the view. For example, ticketForm_SubmitText has a default string, but if you set it before it runs, your string will appear on the submit button.

If you want created tickets to have associated tags, those should also be set before the view runs.

Customizations

The text on the MyTicketView is fully customizable by setting the following properties:

@property NSString * ticketForm_InstructionText;
@property NSString * ticketForm_SubmitText;
@property NSString * ticketForm_SubmitErrorText;
@property NSString * ticketForm_SubmitSuccessText;
@property NSString * ticketForm_OpenFormButtonText;

@property NSString * ticketTable_OpenTicketsTitle;
@property NSString * ticketTable_ClosedTicketsTitle;

@property NSString * ticketTable_NoOpenTicketsText;
@property NSString * ticketTable_NoClosedTicketsText;
@property NSString * ticketTable_NoTicketsText;

Ticket API

We recommend using the prepackaged ticket view, but you can create your own tickets or ticket form using the following API calls:

bool R2IsTicketOpen();
void R2OpenTicket(NSString *text, NSString *name, NSArray *tags, NSDictionary *data);

R2OpenTicketLocation(NSString *text, NSString *name, NSArray *tags, double lat, double lng, NSDictionary *data);

void R2CloseTicket(R2Ticket *ticket);

R2OpenTicket

  • text: anything descriptive, usually a user’s question, but it could be from a list of questions, a service request, or describe a condition that caused the ticket.
  • name: optional but help make the support experience more personal
  • tags: an array of strings that allows a ticket to be routed to the best expertise.  For example, those who view community tickets may be filtered to match tags for region, department, specialty, etc.
  • data: an optional dictionary of name, value pairs.  These can be anything such as details about the app or user account.

R2OpenTicketLocation

Use this api call to open a ticket that has location.  Thi location can be used to display tickets on a map or route to a store or department by region.

  • text: anything descriptive, usually a user’s question, but it could be from a list of questions, a service request, or describe a condition that caused the ticket.
  • name: optional but help make the support experience more personal
  • lat, lng: the latitude and longitude of where the ticket was created.
  • data: an optional dictionary of name, value pairs.  These can be anything such as details about the app or user account.

R2IsTicketOpen

This function will check to see if the user has an open ticket.

R2CloseTicket

Tickets can be closed on in an app or in the support portal. Closed tickets are visible in the app’s history in R2MyTicketViewController. Support calls are not allowed if there are no open tickets in an app.