Пример #1
0
        private static void UpdateIssue(JiraSoapServiceService jiraSoapService, string token, RemoteProject project, JiraIssue jiraIssue)
        {
            string updateMessage = "--- This is an automated message --- " + Environment.NewLine
                + "This issue and the following fields have been updated: " + Environment.NewLine;

            string searchTerms = AreDuplicateIssues(jiraSoapService, token, project, jiraIssue);
            string[] keys = {project.key};

            RemoteComment updateComment = new RemoteComment();
            var existingDuplicateIssue = jiraSoapService.getIssuesFromTextSearchWithProject(token, keys, searchTerms, 1);

            if (jiraIssue.Summary.Replace("\r", string.Empty) != existingDuplicateIssue[0].summary)
            {
                updateMessage += ("-----------------------------------" + Environment.NewLine
                                    +"Summary: " + Environment.NewLine
                                    + jiraIssue.Summary + Environment.NewLine);
            }

            if (jiraIssue.Description.Replace("\r", string.Empty) != existingDuplicateIssue[0].description.Trim())
            {
                int length = jiraIssue.Description.Length;
                for (int i = 0; i < length; i++)
                {
                    if (jiraIssue.Description[i] != existingDuplicateIssue[0].description[i])
                        break;
                }

                int len = existingDuplicateIssue[0].description.Length;
                updateMessage += ("-----------------------------------" + Environment.NewLine
                                    +"Description: " + Environment.NewLine
                                    + jiraIssue.Description + Environment.NewLine);
            }

            else
            {
                updateMessage = "--- This is an automated message --- " + Environment.NewLine
                                + "Identical issue with no updated fields was attempted to be imported";
            }

            updateComment.body = updateMessage;
            jiraSoapService.addComment(token, existingDuplicateIssue[0].key, updateComment);

            System.Diagnostics.Debug.WriteLine("Successfully updated issue http://pm.iqmetrix.com/browse/" + existingDuplicateIssue[0].key);
            Console.WriteLine("Successfully updated issue http://pm.iqmetrix.com/browse/" + existingDuplicateIssue[0].key + Environment.NewLine);
        }
Пример #2
0
        private static void PushToJira(JiraSoapServiceService jiraSoapService, string token, RemoteIssue issue, RemoteComment comment)
        {
            RemoteIssue returnedIssue = jiraSoapService.createIssue(token, issue);
            jiraSoapService.addComment(token, returnedIssue.key, comment);

            System.Diagnostics.Debug.WriteLine("Successfully created issue http://pm.iqmetrix.com/browse/" + returnedIssue.key);
            Console.WriteLine("Successfully created issue http://pm.iqmetrix.com/browse/" + returnedIssue.key + Environment.NewLine);
        }