Skip to content

Commit

Permalink
Merge pull request #642 from nyaruka/open_ticket_event_tweak
Browse files Browse the repository at this point in the history
Set opened_by_id on the open ticket event as well as the ticket itself
  • Loading branch information
rowanseymour authored Jul 21, 2022
2 parents 12b3579 + e549b9d commit 8a5e307
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/hooks/insert_tickets.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (h *insertTicketsHook) Apply(ctx context.Context, rt *runtime.Runtime, tx *
openEvents := make([]*models.TicketEvent, len(tickets))
eventsByTicket := make(map[*models.Ticket]*models.TicketEvent, len(tickets))
for i, ticket := range tickets {
evt := models.NewTicketOpenedEvent(ticket, models.NilUserID, ticket.AssigneeID())
evt := models.NewTicketOpenedEvent(ticket, ticket.OpenedByID(), ticket.AssigneeID())
openEvents[i] = evt
eventsByTicket[ticket] = evt
}
Expand Down
1 change: 1 addition & 0 deletions core/models/tickets.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func (t *Ticket) LastActivityOn() time.Time { return t.t.LastActivityOn }
func (t *Ticket) Config(key string) string {
return t.t.Config.GetString(key, "")
}
func (t *Ticket) OpenedByID() UserID { return t.t.OpenedByID }

func (t *Ticket) FlowTicket(oa *OrgAssets) (*flows.Ticket, error) {
modelTicketer := oa.TicketerByID(t.TicketerID())
Expand Down

0 comments on commit 8a5e307

Please sign in to comment.