Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old body field on ticket modifier #1281

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions flows/modifiers/testdata/ticket.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"email": "[email protected]",
"name": "Bob"
},
"note": "this is a note",
"body": "this is a note"
"note": "this is a note"
},
"contact_after": {
"uuid": "5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f",
Expand Down Expand Up @@ -85,8 +84,7 @@
"name": "Computers"
},
"assignee": null,
"note": "Should fail",
"body": "Should fail"
"note": "Should fail"
},
"contact_after": {
"uuid": "5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f",
Expand Down
7 changes: 0 additions & 7 deletions flows/modifiers/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ type ticketModifierEnvelope struct {
Topic *assets.TopicReference `json:"topic" validate:"required"`
Assignee *assets.UserReference `json:"assignee"`
Note string `json:"note"`

Body string `json:"body"` // deprecated
}

func readTicketModifier(assets flows.SessionAssets, data json.RawMessage, missing assets.MissingCallback) (flows.Modifier, error) {
Expand All @@ -73,10 +71,6 @@ func readTicketModifier(assets flows.SessionAssets, data json.RawMessage, missin
return nil, err
}

if e.Note == "" && e.Body != "" {
e.Note = e.Body
}

topic := assets.Topics().Get(e.Topic.UUID)
if topic == nil {
missing(e.Topic, nil)
Expand All @@ -100,6 +94,5 @@ func (m *TicketModifier) MarshalJSON() ([]byte, error) {
Topic: m.topic.Reference(),
Assignee: m.assignee.Reference(),
Note: m.note,
Body: m.note,
})
}
Loading