Beispiel #1
0
        private Incident CreateTicket(string ServiceDesk)
        {
            Incident ticket = new Incident();
            string InitString;

            if (ServiceDesk == "MSO_Servicedesk")
            {
                InitString = "MSO_Eerstelijn";
            }
            else
            {
                InitString = "VDT_Eerstelijn";
            }

            GetServiceDeskRequest sdReq = new GetServiceDeskRequest();
            ServiceDeskDefinitionRequest sdFilter = new ServiceDeskDefinitionRequest();
            sdFilter.ServiceDeskName = ServiceDesk;
            sdReq.ServiceDeskDefinitionRequest = sdFilter;

            var sdRes = sDesk.ProcessRequest(sdReq);

            //Default Ticket Config
            ticket.AssigneeType = Intake.SDWS.AssigneeType.POOL;
            ticket.Assignee = GetAssignee(sdRes.ServiceDeskDefinitionResponse);
            ticket.AssigneeTypeSpecified = true;
            //ticket.AssigneeEmail = ""; //ToDo: somthing to find the correct name and email.
            ticket.EditingTemplate = sdRes.ServiceDeskDefinitionResponse.EditingTemplate;
            ticket.IsUnread = true;
            ticket.IsUnreadSpecified = true;
            ticket.LastEditDateTime = DateTime.Now;
            ticket.LastEditDateTimeSpecified = true;
            ticket.Policy = sdRes.ServiceDeskDefinitionResponse.DefaultPolicy;
            ticket.Priority = sdRes.ServiceDeskDefinitionResponse.Priority[0].@ref;
            ticket.ServiceDeskDefinition = sdRes.ServiceDeskDefinitionResponse;
            ticket.ServiceDeskName = sdRes.ServiceDeskDefinitionResponse.Name;
            ticket.Severity = sdRes.ServiceDeskDefinitionResponse.Severity.FirstOrDefault(s => s.id == sdRes.ServiceDeskDefinitionResponse.DefaultSeverity).@ref;
            ticket.SourceType = SourceType.Other;
            ticket.SourceTypeSpecified = true;
            ticket.Stage = sdRes.ServiceDeskDefinitionResponse.Stages.FirstOrDefault(s => s.Initialization == InitString).Item.@ref;
            ticket.Status = sdRes.ServiceDeskDefinitionResponse.Status.FirstOrDefault(s => s.Value == "Nieuw").@ref;
            var user = GetUserInfo(User.Identity.Name);
            ticket.Submitter = user.FullName;
            ticket.SubmitterEmail = user.Email;
            ticket.SubmitterPhone = user.Phone;
            var extraFields = sdRes.ServiceDeskDefinitionResponse.CustomFields;
            List<SDWS.CustomField> list = new List<SDWS.CustomField>();
            foreach (var item in extraFields)
            {
                CustomField cf = new CustomField();

                cf.fieldName = item.FieldName;
                if (cf.fieldName == "Urgentie")
                {
                    cf.Value = "1 - Laag";
                }
                else if (cf.fieldName == "Afkomst")
                {
                    cf.Value = "Telefoon";
                }
                else if (cf.fieldName == "Afkomst")
                {
                    cf.Value = "Telefoon";
                }
                {
                    cf.Value = item.DefaultValue;
                }
                list.Add(cf);
            }
            ticket.CustomFields = list.ToArray();

            return ticket;
        }
Beispiel #2
0
 /// <remarks/>
 public void GetServiceDeskAsync(GetServiceDeskRequest req) {
     this.GetServiceDeskAsync(req, null);
 }
Beispiel #3
0
 /// <remarks/>
 public void GetServiceDeskAsync(GetServiceDeskRequest req, object userState) {
     if ((this.GetServiceDeskOperationCompleted == null)) {
         this.GetServiceDeskOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetServiceDeskOperationCompleted);
     }
     this.InvokeAsync("GetServiceDesk", new object[] {
                 req}, this.GetServiceDeskOperationCompleted, userState);
 }
Beispiel #4
0
 public GetServiceDeskResponse GetServiceDesk(GetServiceDeskRequest req) {
     object[] results = this.Invoke("GetServiceDesk", new object[] {
                 req});
     return ((GetServiceDeskResponse)(results[0]));
 }