コード例 #1
0
 /// <summary>
 /// Before a comment will be created, the comment will be reformatted.
 /// </summary>
 /// <param name="args"></param>
 /// <returns></returns>
 public IssueComment BeforeComment(IssueCommentEventArgs args)
 {
     try
     {
         args.Entity.Comment = FormatHtmlString(args.Entity.Comment);
     }
     catch (Exception e)
     {
         int    issueID = args.Entity.Id;
         string message = string.Format("Exception BeforeComment: {0}. IssueID: {1}", e.Message, issueID);
         GeminiApp.LogException(e, false, message);
     }
     return(args.Entity);
 }
コード例 #2
0
        public override void AfterComment(IssueCommentEventArgs args)
        {
            var data = GetConfig(args.Context);

            if (data == null || data.Value == null)
            {
                return;
            }

            string channel = GetProjectChannel(args.Issue.Project.Id, data.Value.ProjectChannels);

            if (channel == null || channel.Trim().Length == 0)
            {
                return;
            }

            QuickSlack.Send(data.Value.SlackAPIEndpoint, channel, string.Format("{0} added a comment to <{1}|{2} - {3}>"
                                                                                , args.User.Fullname, args.BuildIssueUrl(args.Issue), args.Issue.IssueKey, args.Issue.Title),
                            "more details attached",
                            "good",
                            new[] { new { title = "Comment", value = StripHTML(args.Entity.Comment), _short = false } }, StripHTML(args.Entity.Comment));

            base.AfterComment(args);
        }
コード例 #3
0
 public IssueComment BeforeComment(IssueCommentEventArgs args)
 {
     return(args.Entity);
 }