public long CreateWorkItem(Dictionary <string, string> values, Dictionary <string, string> overrides)
        {
            AlertSourceIncident incident = CreateIncidentWithDefaults(values);

            if (connectorClient == null)
            {
                connectorClient = ConnectToIcmInstance();
            }

            ApplyOverrides(ref incident, overrides);

            long incidentId = 0;
            IncidentAddUpdateResult result = connectorClient.AddOrUpdateIncident2(
                config.IcmClientConfig.ConnectorId,
                incident,
                RoutingOptions.None);

            if (result?.IncidentId != null)
            {
                incidentId = result.IncidentId.Value;
                WorkItemsCache.Add(values["ConverstionID"], incidentId);
                DateTime createDateTime = result.UpdateProcessTime ?? DateTime.UtcNow;
                InsertRecord(config.IcmClientConfig.RoutingId, values["ConverstionID"], incidentId, createDateTime);
            }
            return(incidentId);
        }
Exemplo n.º 2
0
        public static void MainMethod()
        {
            Guid targetConnector = new Guid("edaa079e-e6b7-4412-9b4d-247f48190d20");

            string title             = "Test CFR Alert";
            string owningTeamId      = "CUSTOMERINSIGHTANDANALYSIS\\CIA";
            string containerPublicId = "ce3e9ffa-927d-4ad3-b2bb-ad34db88c5ef";
            string routingId         = "ciaprod";

            IncidentAddUpdateResult incidentAddUpdateResult = AddOrUpdateIncident(targetConnector, GenerateAlertSourceIncidentFrom(title, owningTeamId, containerPublicId, routingId));

            Console.WriteLine(incidentAddUpdateResult.IncidentId);
            Console.WriteLine(incidentAddUpdateResult.Status);
            Console.WriteLine(incidentAddUpdateResult.SubStatus);
            Console.WriteLine(incidentAddUpdateResult.UpdateProcessTime);
        }
Exemplo n.º 3
0
        public long CreateWorkItem(Dictionary <string, string> values)
        {
            AlertSourceIncident incident = this.CreateIncidentWithDefaults(values);

            if (connectorClient == null)
            {
                connectorClient = ConnectToIcmInstance();
            }

            long incidentId = 0;
            IncidentAddUpdateResult result = connectorClient.AddOrUpdateIncident2(
                config.IcmClientConfig.ConnectorId,
                incident,
                RoutingOptions.None);

            if (result != null && result.IncidentId.HasValue)
            {
                incidentId = result.IncidentId.Value;
                WorkItemsCache.Add(values["ConverstionID"], incidentId);
            }
            return(incidentId);
        }