{"action":"created","issue":{"url":"https://api.github.com/repos/dimagi/commcare-hq/issues/17817","repository_url":"https://api.github.com/repos/dimagi/commcare-hq","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/17817/labels{/name}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/17817/comments","events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/17817/events","html_url":"https://github.com/dimagi/commcare-hq/pull/17817","id":257376834,"number":17817,"title":"zapier new/update case support","user":{"login":"czue","id":66555,"avatar_url":"https://avatars3.githubusercontent.com/u/66555?v=4","gravatar_id":"","url":"https://api.github.com/users/czue","html_url":"https://github.com/czue","followers_url":"https://api.github.com/users/czue/followers","following_url":"https://api.github.com/users/czue/following{/other_user}","gists_url":"https://api.github.com/users/czue/gists{/gist_id}","starred_url":"https://api.github.com/users/czue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czue/subscriptions","organizations_url":"https://api.github.com/users/czue/orgs","repos_url":"https://api.github.com/users/czue/repos","events_url":"https://api.github.com/users/czue/events{/privacy}","received_events_url":"https://api.github.com/users/czue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-13T13:16:52Z","updated_at":"2017-09-14T05:44:12Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/17817","html_url":"https://github.com/dimagi/commcare-hq/pull/17817","diff_url":"https://github.com/dimagi/commcare-hq/pull/17817.diff","patch_url":"https://github.com/dimagi/commcare-hq/pull/17817.patch"},"body":"this implements changes necessary for https://manage.dimagi.com/default.asp?247716\r\n\r\nproduct / @nsclark asked me to look into this and it turned out to be pretty straightforward so just went ahead and implemented it.\r\n\r\n@snopoke and @proteusvacuum you looked at the ticket a long time ago, but in summary this adds two new repeater classes `CreateCaseRepeater` and `UpdateCaseRepeater` which only fire when a case is first created (or the opposite). \r\n\r\nI'm checking for a newly created case by seeing if `xform_ids` has length 1, which, while seemingly hacky I think is actually one of the more consistent ways to do it.\r\n\r\n@proteusvacuum you had suggested using `allowed_to_forward` for this but I opted not to because I wanted to avoid creating a bunch of records in the DB that would never be allowed to forward. so instead this handles it by running the logic in the signal.\r\n\r\nI'll throw a couple comments in a review now where I think there is possibly controversial changes. can be reviewed by commit or all at once.\r\n\r\nThe only user-facing side of this change is adding the following two options to the repeater page:\r\n\r\n![image](https://user-images.githubusercontent.com/66555/30379356-7d2853da-9896-11e7-8b5d-d751dda2631c.png)\r\n\r\nWe could also hide them, though this has the downside of then making it tricker to see your config in HQ when you are using the Zapier integration."},"comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments/329379632","html_url":"https://github.com/dimagi/commcare-hq/pull/17817#issuecomment-329379632","issue_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/17817","id":329379632,"user":{"login":"czue","id":66555,"avatar_url":"https://avatars3.githubusercontent.com/u/66555?v=4","gravatar_id":"","url":"https://api.github.com/users/czue","html_url":"https://github.com/czue","followers_url":"https://api.github.com/users/czue/followers","following_url":"https://api.github.com/users/czue/following{/other_user}","gists_url":"https://api.github.com/users/czue/gists{/gist_id}","starred_url":"https://api.github.com/users/czue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czue/subscriptions","organizations_url":"https://api.github.com/users/czue/orgs","repos_url":"https://api.github.com/users/czue/repos","events_url":"https://api.github.com/users/czue/events{/privacy}","received_events_url":"https://api.github.com/users/czue/received_events","type":"User","site_admin":false},"created_at":"2017-09-14T05:44:12Z","updated_at":"2017-09-14T05:44:12Z","author_association":"OWNER","body":"thanks @millerdev! look for more official news coming through soon.\r\n\r\nzapier has been a sabbatical side project of mine and has been fun to be able to help shepherd it out.\r\n\r\ngood catch on the review, will fix those now"}}
{"actor":{"display_login":"czue"}}