RangerMSP Ticket – Open Count

For reporting or work flow management, knowing how many tickets are open currently or historically by day/week/month/year is important for managing a IT MSP business.In the RangerMSP GUI there is an “Open Date” and a “Close Date” field. However these fields are not available via the RangerMSP API and therefore not available via Jupiter Server.

The RangerMSP data fields that we have access to are listed here.
http://www.rangermsp.com/wiki/CSharp_API#Ticket_Class

Therefore our only option currently available is to on a regular automated basis query Jupiter Server for a list of tickets and store that data for offline processing

The key field to query on is the Status field

* Status FLDTKTSTATUS    The Ticket Status(optional).
* Possible values:
* New = 100
* Pending = 200
* Scheduled = 300
* In - House Service = 400
* On - Site Service = 500
* Laboratory Service = 600
* Hold = 700
* Other = 800
* Cancelled = 900
* Completed = 1000
Currently there is a Jupiter method to get a count of open tickets to make it easier, rather than dragging all the data down to a client app and then obtaining a count. The method is called GetTicketOpenCount.
In the example below the AccountREC_ID of an account that you would like is passed in to get the number of OpenTickets for. But you could use it with a difference Select statement to get all OpenTickets matching a different search criteria.
Here is some C# code showing how to use GetTicketOpenCount in a C# client application that you could write.
Using the above status values, a Open Ticket has a Status value less than 900.
#region GetOpenTicketCount
        public static void GetOpenTicketCount(string accountRecId, out bool success, out int count)
        {
            success = false;
            count = 0;

            try
            {
                Select select = new Select
                {
                    Link = "and",
                    RecordLimit = 1,
                    Criterias = new Criteria[1]
                    {
                        new Criteria
                        {
                            Field = "AccountREC_ID",
                            Operation = "opEqual",
                            Value = accountRecId
                        }
                    }
                };

                count = RangerMSPClient.GetTicketOpenCount(select);
            }
            catch (Exception e)
            {
                Global.GenericException(e);
            }

            success = true;
        }
#endregion