{"action":"closed","issue":{"url":"https://api.github.com/repos/CodeForPhilly/stately/issues/20","repository_url":"https://api.github.com/repos/CodeForPhilly/stately","labels_url":"https://api.github.com/repos/CodeForPhilly/stately/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/CodeForPhilly/stately/issues/20/comments","events_url":"https://api.github.com/repos/CodeForPhilly/stately/issues/20/events","html_url":"https://github.com/CodeForPhilly/stately/issues/20","id":180526233,"number":20,"title":"Action handlers should be passed event history","user":{"login":"timwis","id":761444,"avatar_url":"https://avatars.githubusercontent.com/u/761444?v=3","gravatar_id":"","url":"https://api.github.com/users/timwis","html_url":"https://github.com/timwis","followers_url":"https://api.github.com/users/timwis/followers","following_url":"https://api.github.com/users/timwis/following{/other_user}","gists_url":"https://api.github.com/users/timwis/gists{/gist_id}","starred_url":"https://api.github.com/users/timwis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timwis/subscriptions","organizations_url":"https://api.github.com/users/timwis/orgs","repos_url":"https://api.github.com/users/timwis/repos","events_url":"https://api.github.com/users/timwis/events{/privacy}","received_events_url":"https://api.github.com/users/timwis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/CodeForPhilly/stately/milestones/1","html_url":"https://github.com/CodeForPhilly/stately/milestones/MVP","labels_url":"https://api.github.com/repos/CodeForPhilly/stately/milestones/1/labels","id":2043706,"number":1,"title":"MVP","description":"","creator":{"login":"timwis","id":761444,"avatar_url":"https://avatars.githubusercontent.com/u/761444?v=3","gravatar_id":"","url":"https://api.github.com/users/timwis","html_url":"https://github.com/timwis","followers_url":"https://api.github.com/users/timwis/followers","following_url":"https://api.github.com/users/timwis/following{/other_user}","gists_url":"https://api.github.com/users/timwis/gists{/gist_id}","starred_url":"https://api.github.com/users/timwis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timwis/subscriptions","organizations_url":"https://api.github.com/users/timwis/orgs","repos_url":"https://api.github.com/users/timwis/repos","events_url":"https://api.github.com/users/timwis/events{/privacy}","received_events_url":"https://api.github.com/users/timwis/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":3,"state":"open","created_at":"2016-10-03T10:47:38Z","updated_at":"2016-10-19T03:06:10Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-10-02T18:22:32Z","updated_at":"2016-10-19T03:06:10Z","closed_at":"2016-10-19T03:06:10Z","body":"In order for [indebtedness](https://github.com/CodeForPhilly/stately/blob/master/workflows/indebtedness.yml#L28-L29) to check whether other events have taken place, the handlers need access to the event history. I have an idea of how to do this, but not sure it'd be the _right_ way..\r\n\r\nWe could put the following inside [get_handler_context](https://github.com/CodeForPhilly/stately/blob/master/server/src/stately/models.py#L280)\r\n```python\r\ncontext['events'] = (self.case.events.all() or []).copy()\r\n```\r\nBut I imagine that won't have the `action.name` broken out...so we'd probably want to create a helper method in the `Case` model. And at that point we could use it in the `serialize_case` view."}}
{"actor":{"display_login":"mjumbewu"}}