Example #1
0
        public string SendTextFromOriginalTicket(int id, string listTitle)
        {
            ServiceDeskRequests serviceDeskItem = new ServiceDeskRequests();
            ListItemLoader      listItemLoader  = new ListItemLoader();
            ListItem            listItem        = listItemLoader.GetListItem(id, listTitle, new List <string> {
                "TicketID"
            });
            int    ticketID   = ((FieldLookupValue)listItem["TicketID"]).LookupId;
            Ticket ticket     = serviceDeskItem.GetTicket(ticketID);
            string textToSend = "Subject: " + ticket.Subject.ToString() + " " + "Original text: " + ticket.Body.ToString();

            return(textToSend);
        }
        public string GetEmailFromOriginalTicket(int id, string listTitle)
        {
            ListItemLoader listItemLoader = new ListItemLoader();
            ListItem       listItem       = listItemLoader.GetListItem(id, listTitle, new List <string> {
                "From"
            });
            string resultFrom = listItem["From"].ToString();

            if (listItem["From"] != null)
            {
                FieldUserValue user = (FieldUserValue)listItem["From"];
                resultFrom = user.Email;
            }

            return(resultFrom);
        }