Пример #1
0
        public List <ServiceTicket> CollectServiceTickets(string filter)
        {
            List <string> fields = new List <string>();

            fields.Add("Id");
            ServiceTicketApi        serviceTicketApi = new ServiceTicketApi(site, company, username, password, cookie);
            List <TicketFindResult> results          = serviceTicketApi.FindServiceTickets(filter, "Id", null, null, null, fields);

            logger.Info("Found " + results.Count + " Service tickets. Getting detailed ticket info...");
            List <ServiceTicket> fullTickets = new List <ServiceTicket>();
            int i = 0;

            foreach (TicketFindResult ticket in results)
            {
                i++;
                if ((i % 100) == 0)
                {
                    logger.Info(i);
                }

                try
                {
                    ServiceTicket ticketDetail = serviceTicketApi.GetServiceTicket(ticket.Id);

                    if (ticketDetail != null)
                    {
                        fullTickets.Add(ticketDetail);
                    }
                    else
                    {
                        logger.Info("Ticket details not found for: " + ticket.Id);
                    }
                }
                catch (Exception e)
                {
                    logger.Error("Error getting ticket: " + ticket.Id + " - " + e.Message);
                }
            }
            return(fullTickets);
        }
Пример #2
0
        public ServiceTicket getTicket(int ticketId)
        {
            ServiceTicketApi serviceTicketApi = new ServiceTicketApi(site, company, username, password, cookie);

            return(serviceTicketApi.GetServiceTicket(ticketId));
        }
Пример #3
0
 public ServiceTicket getTicket(int ticketId)
 {
     ServiceTicketApi serviceTicketApi = new ServiceTicketApi(site, company, username, password, cookie);
     return serviceTicketApi.GetServiceTicket(ticketId);
 }
Пример #4
0
        public List<ServiceTicket> CollectServiceTickets(string filter)
        {
            List<string> fields = new List<string>();
            fields.Add("Id");
            ServiceTicketApi serviceTicketApi = new ServiceTicketApi(site, company, username, password, cookie);
            List<TicketFindResult> results = serviceTicketApi.FindServiceTickets(filter, "Id", null, null, null, fields);
            logger.Info("Found " + results.Count + " Service tickets. Getting detailed ticket info...");
            List<ServiceTicket> fullTickets = new List<ServiceTicket>();
            int i = 0;
            foreach (TicketFindResult ticket in results)
            {
                i++;
                if ((i % 100) == 0)
                    logger.Info(i);

                try
                {
                    ServiceTicket ticketDetail = serviceTicketApi.GetServiceTicket(ticket.Id);

                    if (ticketDetail != null)
                        fullTickets.Add(ticketDetail);
                    else
                        logger.Info("Ticket details not found for: " + ticket.Id);
                }
                catch (Exception e)
                {
                    logger.Error("Error getting ticket: " + ticket.Id + " - " + e.Message);
                }
            }
            return fullTickets;
        }