Skip to content

Instantly share code, notes, and snippets.

@leojpod
Created March 30, 2017 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leojpod/05d60a80504ce19d6a60f351acb050c8 to your computer and use it in GitHub Desktop.
Save leojpod/05d60a80504ce19d6a60f351acb050c8 to your computer and use it in GitHub Desktop.
the better way
assignTo : String -> Item -> Item
assignTo user task =
let
updateAssignee taskProperties =
{ taskProperties | assignee = Just user }
in
case task of
Task props ->
Task (updateAssignee props)
SubTask props ->
SubTask (updateAssignee props)
Bug props ->
Bug (updateAssignee props)
Epic props ->
Epic props -- i.e. remain unchanged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment