public ProjectIssueRequiredFieldsMap AddOne(JiraProject projectId)
        {
            var map = new ProjectIssueRequiredFieldsMap
            {
                Project = new IdentfierDescriptor
                {
                    ID   = projectId.ID,
                    Key  = projectId.Key,
                    Name = projectId.Name
                }
            };

            Maps.Add(map);
            return(map);
        }
 private bool GetRequiredFieldValue(ProjectIssueRequiredFieldsMap projectMap)
 {
     if (CurrentAssignProject != null && JiraOperator != null)
     {
         var waitingForm =
             new FormWaiting(
                 new Task <object>(
                     () =>
         {
             try
             {
                 return((object)JiraOperator.GetIssueCreateMeta(CurrentAssignProject.ID,
                                                                CurrentSelectedIssueType.Name));
             }
             catch (Exception)
             {
                 return(null);
             }
         }));
         if (waitingForm.ShowDialog() == DialogResult.OK)
         {
             var meta = waitingForm.Result as JiraCreateIssueMeta;
             if (meta != null && meta.IssueTypes != null)
             {
                 var currentMeta = meta.IssueTypes.FirstOrDefault();
                 if (currentMeta != null)
                 {
                     var issue    = new IssueRequiredFieldsMap();
                     var required =
                         currentMeta.Fields.Where(
                             m => String.IsNullOrWhiteSpace(m.Value.Schema.System) && m.Value.Required).ToDictionary(
                             pair => pair.Key, pair => pair.Value);
                     var requiredSystemFields = currentMeta.Fields.Where(
                         m => !String.IsNullOrWhiteSpace(m.Value.Schema.System)).ToDictionary(
                         pair => pair.Key, pair => pair.Value);
                     if (required.Keys.Count > 0)
                     {
                         var requireField = new FormReqiuredFields(required);
                         if (requireField.ShowDialog() == DialogResult.OK)
                         {
                             issue.IssueType = new JiraIssueType {
                                 Name = CurrentSelectedIssueType.Name
                             };
                             issue.RequiredFieldsJsonValue = requireField.FieldsValues;
                             issue.SystemField             = requiredSystemFields.Values.ToList();
                             projectMap.AddUniqueIssue(issue);
                             return(true);
                         }
                     }
                     else
                     {
                         issue.IssueType = new JiraIssueType {
                             Name = CurrentSelectedIssueType.Name
                         };
                         issue.NoRequiredFields = true;
                         issue.SystemField      = requiredSystemFields.Values.ToList();
                         projectMap.AddUniqueIssue(issue);
                         return(true);
                     }
                 }
             }
         }
     }
     return(false);
 }
 public ProjectIssueRequiredFieldsMap AddOne(JiraProject projectId)
 {
     var map = new ProjectIssueRequiredFieldsMap
         {
             Project = new IdentfierDescriptor
                 {
                     ID = projectId.ID,
                     Key = projectId.Key,
                     Name = projectId.Name
                 }
         };
     Maps.Add(map);
     return map;
 }