/// <summary> /// Gets the activity comment. /// </summary> /// <param name="activity">The activity.</param> /// <param name="commentFlag">The comment flag.</param> /// <param name="commentBy">The user making the comment.</param> /// <param name="comment">The comment content.</param> /// <param name="args">Optional arguments to use as replacement values in the comment text.</param> /// <returns></returns> private TicketComment GetActivityComment(TicketActivity activity, TicketCommentFlag commentFlag, string comment, string assignedTo, string[] notificationSubscribers, params string[] args) { TicketComment c = new TicketComment(); c.Comment = comment; c.CommentedBy = Security.CurrentUserName; c.CommentedDate = DateTime.Now; c.CommentEvent = TicketTextUtility.GetCommentText(activity, commentFlag, args); c.IsHtml = false; var isNewOrGiveUp = (assignedTo == null) && (activity == TicketActivity.GiveUp || activity == TicketActivity.Create || activity == TicketActivity.CreateOnBehalfOf); Notification.AddTicketEventNotifications(c, isNewOrGiveUp, notificationSubscribers); return c; }
/// <summary> /// Creates the activity event. /// </summary> /// <param name="eventByUserId">The event by user identifier.</param> /// <param name="activity">The activity.</param> /// <param name="comment">The comment.</param> /// <param name="newPriority">The new priority.</param> /// <param name="userName">Name of the user.</param> /// <returns>TicketEvent.</returns> public static TicketEvent CreateActivityEvent( string eventByUserId, TicketActivity activity, string comment, string newPriority, string userName) { var tc = new TicketEvent { Comment = comment, EventBy = eventByUserId, EventDate = DateTime.Now, EventDescription = TicketTextUtility.GetTicketEventDescription(activity, newPriority, userName), IsHtml = false }; return(tc); }