public override string CreateDefect(Dictionary <string, string> defectInfos)
        {
            Connect();

            RemoteIssue issue = new RemoteIssue();

            RemotePriority[]  priorities = jira.getPriorities(jiraToken);
            RemoteIssueType[] issueTypes = jira.getIssueTypes(jiraToken);
            jira.getProjectRoles(jiraToken);

            issue.created = DateTime.Now;
            issue.summary = "TOSCA[" + defectInfos["Workspace-User"] + "]: Error in Testcase \""
                            + defectInfos["TestCase-Name"] + "\"";
            string description = defectInfos["Log-Description"];

            if (!String.IsNullOrEmpty(description))
            {
                issue.description = description;
            }
            else
            {
                String compressedLog = defectInfos["CompressedLogDetails"];
                issue.description = String.IsNullOrEmpty(compressedLog)
                    ? String.Empty
                    : GetLogInfoFromCompressedLogDetails(compressedLog);
            }
            issue.assignee = GetDefectIntegrationSetting("DefectAssignee", defectInfos);
            if (issue.assignee == string.Empty)
            {
                issue.assignee = "-1";
            }

            issue.project  = GetDefectIntegrationSetting("DefectProject", defectInfos);
            issue.priority = GetDefectIntegrationSetting("DefectPriority", defectInfos);
            foreach (RemotePriority priority in priorities)
            {
                if (priority.name == issue.priority)
                {
                    issue.priority = priority.id;
                    break;
                }
            }
            issue.status = GetDefectIntegrationSetting("DefectStatus", defectInfos);
            issue.type   = GetDefectIntegrationSetting("DefectType", defectInfos);
            foreach (RemoteIssueType issueType in issueTypes)
            {
                if (issueType.name == issue.type)
                {
                    issue.type = issueType.id;
                    break;
                }
            }
            issue.components = GetComponents(GetDefectIntegrationSetting("DefectComponents", defectInfos));

            issue.customFieldValues = GetCustomDefectProperties(defectInfos).Select(property => new RemoteCustomFieldValue {
                customfieldId = "customfield_" + property.id, values = property.value.Split(',')
            }).ToArray();
            issue = jira.createIssue(jiraToken, issue);
            Disconnect();

            return(issue != null ? issue.key : string.Empty);
        }
 public List <JiraNamedEntity> getIssueTypes()
 {
     return(createEntityListFromConstants(service.getIssueTypes(Token)));
 }