Defines additional details for a trigger.
        private void CreateIncident()
        {
            WebClient client = new WebClient();
            client.Headers[HttpRequestHeader.Accept] = "application/json";
            client.Headers[HttpRequestHeader.ContentType] = "application/json";

            client.UploadStringCompleted += (object source, UploadStringCompletedEventArgs e) =>
            {
                if (e.Error != null || e.Cancelled)
                {
                    Console.WriteLine("Error" + e.Error);
                    Console.ReadKey();
                }
            };

            JavaScriptSerializer js = new JavaScriptSerializer();
            TriggerDetails triggerDetails = new TriggerDetails(Component, Details);
            var detailJson = js.Serialize(triggerDetails);

            //Alert name should be unique for each alert - as alert name is used as incident key in pagerduty.
            string key = ConfigurationManager.AppSettings["PagerDutyServiceKey"];
            if (!string.IsNullOrEmpty(EscPolicy))
            {
                key = ConfigurationManager.AppSettings["PagerDutySev1ServiceKey"];
            }
            if (string.IsNullOrEmpty(key))
            {
                key = ConfigurationManager.AppSettings["PagerDutyServiceKey"];
            }
            
            Trigger trigger = new Trigger(key,AlertName,AlertSubject,detailJson);           
            var triggerJson = js.Serialize(trigger);
            client.UploadString(new Uri("https://events.pagerduty.com/generic/2010-04-15/create_event.json"), triggerJson); 
            
        }
        private void CreateIncident()
        {
            WebClient client = new WebClient();

            client.Headers[HttpRequestHeader.Accept]      = "application/json";
            client.Headers[HttpRequestHeader.ContentType] = "application/json";

            client.UploadStringCompleted += (object source, UploadStringCompletedEventArgs e) =>
            {
                if (e.Error != null || e.Cancelled)
                {
                    Console.WriteLine("Error" + e.Error);
                    Console.ReadKey();
                }
            };

            JavaScriptSerializer js             = new JavaScriptSerializer();
            TriggerDetails       triggerDetails = new TriggerDetails(Component, Details);
            var detailJson = js.Serialize(triggerDetails);

            Trigger trigger     = new Trigger(ConfigurationManager.AppSettings["PagerDutyServiceKey"], AlertName, AlertSubject, detailJson);
            var     triggerJson = js.Serialize(trigger);

            client.UploadString(new Uri("https://events.pagerduty.com/generic/2010-04-15/create_event.json"), triggerJson);
        }
        private void CreateIncident()
        {
            WebClient client = new WebClient();

            client.Headers[HttpRequestHeader.Accept]      = "application/json";
            client.Headers[HttpRequestHeader.ContentType] = "application/json";

            client.UploadStringCompleted += (object source, UploadStringCompletedEventArgs e) =>
            {
                if (e.Error != null || e.Cancelled)
                {
                    Console.WriteLine("Error" + e.Error);
                    Console.ReadKey();
                }
            };

            JavaScriptSerializer js             = new JavaScriptSerializer();
            TriggerDetails       triggerDetails = new TriggerDetails(Component, Details);
            var detailJson = js.Serialize(triggerDetails);

            //Alert name should be unique for each alert - as alert name is used as incident key in pagerduty.
            string key = ConfigurationManager.AppSettings["PagerDutyServiceKey"];

            if (!string.IsNullOrEmpty(EscPolicy))
            {
                key = ConfigurationManager.AppSettings["PagerDutySev1ServiceKey"];
            }
            if (string.IsNullOrEmpty(key))
            {
                key = ConfigurationManager.AppSettings["PagerDutyServiceKey"];
            }

            Trigger trigger     = new Trigger(key, AlertName, AlertSubject, detailJson);
            var     triggerJson = js.Serialize(trigger);

            client.UploadString(new Uri("https://events.pagerduty.com/generic/2010-04-15/create_event.json"), triggerJson);
        }