Example #1
0
        public void AddComment(string issueID, string Comment)
        {
            XMLParse _oWaXmlData = new XMLParse();

            _oWaXmlData.LoadXML("../../Config/ApplicationSettings.xml");
            jiraURL      = _oWaXmlData.getData("settings/JiraCredentials", "URL");
            jiraUsername = _oWaXmlData.getData("settings/JiraCredentials", "UserName");
            jiraPassword = _oWaXmlData.getData("settings/JiraCredentials", "Password");
            jiraConn     = new Jira(jiraURL[0], jiraUsername[0], jiraPassword[0]);

            try
            {
                Issue issue = jiraConn.GetIssue(issueID);
                issue.AddComment(Comment);
                issue.SaveChanges();
                Console.WriteLine("Comment added to Issue - " + issueID + " Successfully");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Example #2
0
        public void AddAndGetComments()
        {
            var summaryValue = "Test Summary " + _random.Next(int.MaxValue);
            var issue        = new Issue(_jira, "TST")
            {
                Type     = "1",
                Summary  = summaryValue,
                Assignee = "admin"
            };

            // create an issue, verify no comments
            issue.SaveChanges();
            Assert.Equal(0, issue.GetComments().Count);

            // Add a comment
            issue.AddComment("new comment");

            var comments = issue.GetComments();

            Assert.Equal(1, comments.Count);
            Assert.Equal("new comment", comments[0].Body);
        }
Example #3
0
        public void CommentOnIssue(string issueId, string comment)
        {
            Issue issue = _jira.GetIssue(issueId);

            issue.AddComment(comment);
        }