コード例 #1
0
 internal void AddComment(GitChangeSet changeSet)
 {
     foreach (var ticket in changeSet.JiraTickets)
     {
         this.CreateComment(changeSet, ticket);
     }
 }
コード例 #2
0
        private void CreateComment(GitChangeSet changeSet, string ticket)
        {
            var issueRef = new IssueRef {
                id = ticket
            };

            var issue = this.Client.LoadIssue(issueRef);

            if (issue == null)
            {
                return;
            }

            this.Client.CreateComment(issueRef, changeSet.ToString());
        }
コード例 #3
0
        static void Main(string[] args)
        {
            string branch, author, email, commitDate, title, files, body;

            if (args.Length == 7)
            {
                branch     = args[0];
                author     = args[1];
                email      = args[2];
                commitDate = args[3];
                title      = args[4];
                files      = args[5];
                body       = args[6];
            }
            else
            {
                branch     = "Test-Branch";
                author     = "Author";
                email      = "*****@*****.**";
                commitDate = DateTime.Now.ToLongDateString();
                title      = "[JIRA-TICKET] this is a test";
                files      = "file1.txt, file2.txt";
                body       = "Body";
            }

            var jira = new JiraAntiCorruption(JiraCredentials.GetCredentials());

            var changeSet = GitChangeSet.Generate(branch, author, email, commitDate, title, files, body);

            try
            {
                jira.AddComment(changeSet);
            }
            catch (Exception e)
            {
                LogAction(branch, author, email, commitDate, title, files, body, e);
            }
        }