Exemple #1
0
        public bool AddComment(int ticketId, Comment comment)
        {
            var request = new ZenRestRequest
            {
                Method = Method.PUT,
                Resource = string.Format("{0}/{1}.xml", Tickets, ticketId)
            };
            request.AddBody(comment);

            var res = Execute(request);

            return res.StatusCode == System.Net.HttpStatusCode.OK;
        }
Exemple #2
0
        public bool UpdateTicketAsEndUser(int ticketId, Comment comment)
        {
            string email = GetUserById(GetTicketById(ticketId).RequesterId).Email;

            var request = new ZenRestRequest
            {
                Method = Method.PUT,
                Resource = string.Format("{0}/{1}.xml", Requests, ticketId.ToString())
            };

            request.AddHeader(XOnBehalfOfEmail, email);
            request.AddBody(comment);

            //request.AddParameter("text/xml", string.Format("<ticket><subject>{0}</subject><description>{1}</description></ticket>", ticket.Subject, ticket.Description), ParameterType.RequestBody);

            var res = Execute(request);

            return res.StatusCode == System.Net.HttpStatusCode.OK;
        }