Beispiel #1
0
        public void UpdateTag(Ticket ticket, TicketTagGroup tagGroup, TicketTag ticketTag)
        {
            ticket.SetTagValue(tagGroup.Name, ticketTag.Name);

            if (tagGroup.FreeTagging && tagGroup.SaveFreeTags)
            {
                SaveFreeTicketTag(tagGroup.Id, ticketTag.Name);
            }

            var tagData = new TicketTagData
            {
                Ticket = ticket,
                TicketTagGroup = tagGroup,
                TagName = tagGroup.Name,
                TagValue = ticketTag.Name
            };

            _applicationState.NotifyEvent(RuleEventNames.TicketTagSelected,
                        new
                        {
                            Ticket = ticket,
                            tagData.TagName,
                            tagData.TagValue,
                            NumericValue = tagGroup.IsNumeric ? Convert.ToDecimal(ticketTag.Name) : 0,
                            TicketTag = ticket.GetTagData()
                        });
        }
Beispiel #2
0
 public void UpdateTag(Ticket ticket, string tagName, string tagValue)
 {
     var tagGroup = _cacheService.GetTicketTagGroupByName(tagName);
     if (tagGroup != null)
     {
         UpdateTag(ticket, tagGroup, tagValue);
     }
     else
     {
         ticket.SetTagValue(tagName, tagValue);
     }
 }