{"action":"created","issue":{"url":"https://api.github.com/repos/octobox/octobox/issues/1110","repository_url":"https://api.github.com/repos/octobox/octobox","labels_url":"https://api.github.com/repos/octobox/octobox/issues/1110/labels{/name}","comments_url":"https://api.github.com/repos/octobox/octobox/issues/1110/comments","events_url":"https://api.github.com/repos/octobox/octobox/issues/1110/events","html_url":"https://github.com/octobox/octobox/issues/1110","id":370701993,"node_id":"MDU6SXNzdWUzNzA3MDE5OTM=","number":1110,"title":"Automated actions","user":{"login":"andrew","id":1060,"node_id":"MDQ6VXNlcjEwNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1060?v=4","gravatar_id":"","url":"https://api.github.com/users/andrew","html_url":"https://github.com/andrew","followers_url":"https://api.github.com/users/andrew/followers","following_url":"https://api.github.com/users/andrew/following{/other_user}","gists_url":"https://api.github.com/users/andrew/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew/subscriptions","organizations_url":"https://api.github.com/users/andrew/orgs","repos_url":"https://api.github.com/users/andrew/repos","events_url":"https://api.github.com/users/andrew/events{/privacy}","received_events_url":"https://api.github.com/users/andrew/received_events","type":"User","site_admin":false},"labels":[{"id":502307482,"node_id":"MDU6TGFiZWw1MDIzMDc0ODI=","url":"https://api.github.com/repos/octobox/octobox/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-16T16:45:17Z","updated_at":"2018-11-13T17:26:50Z","closed_at":null,"author_association":"MEMBER","body":"Now that we have [advanced search](https://github.com/octobox/octobox/issues/742), we can start on the next big feature for Octobox: [Notification filters and automated actions](https://github.com/octobox/octobox/blob/master/docs/ROADMAP.md#notification-filters-and-automated-actions-8)\r\n\r\nThere's a lot of potential scope to this so I'm going to try and break it down into a few parts in this issue.\r\n\r\nRather than providing a specific set of functions that can be fired when specific events happen, we want to enable people to configure the custom actions they need from a set of building blocks, similar to [Gmail filters](https://zapier.com/blog/gmail-filters/) or [IFTTT](https://ifttt.com/). We can then add more functions and search prefixes over time.\r\n\r\nPotential functions we can do now:\r\n\r\n- Archive a notification\r\n- Unarchive a notification\r\n- Star a notification\r\n- Unstar a notification\r\n- Delete a notification\r\n- Mark a notification as read\r\n- Mark a notification as unread\r\n- Unsubscribe/mute a notification\r\n\r\nPotential events to trigger those functions:\r\n\r\n- New notification created\r\n- Existing notification changed\r\n- A notifications subject synced and changed*\r\n- A notifications labels synced and changed*\r\n- A notifications repository synced and changed*\r\n\r\n*if subject syncing/github app enabled\r\n\r\nThe way I imagine this working in essentially is:\r\n\r\n- create an action with:\r\n  - a function\r\n  - a search query that will match notifications you want to run the function on\r\n- when an event triggers on a notification\r\n - for each of your actions\r\n   - see if the notification matches the search query\r\n   - run the function on that notification\r\n\r\nOne thing that's going to be very helpful to this is an event log. Being able to see what has happened behind the scenes of your octobox account, example of events to be logged:\r\n\r\n- New notification synced\r\n- Existing notification synced\r\n- New Subject synced\r\n- Existing Subject synced\r\n\r\nAnd in then as we enable actions we can also add events there too, which will help people understand how their actions are working and when those actions have triggered.\r\n\r\nSome functions we may be able to add in the future for issues and pull requests:\r\n\r\n- Close/reopen\r\n- Lock/unlock\r\n- Edit description\r\n- Add/update/remove labels\r\n- Add/update/remove milestone \r\n- Add/update/remove project\r\n- Leave a comment\r\n- Add/update/remove assignees\r\n- Add/remove reaction\r\n\r\n<hr/>\r\n\r\nRelated issues:\r\n\r\n- https://github.com/octobox/octobox/issues/8\r\n- https://github.com/octobox/octobox/issues/1087\r\n- https://github.com/octobox/octobox/issues/188\r\n- https://github.com/octobox/octobox/issues/342\r\n- https://github.com/octobox/octobox/issues/599\r\n- https://github.com/octobox/octobox/pull/752\r\n- https://github.com/octobox/octobox/issues/893"},"comment":{"url":"https://api.github.com/repos/octobox/octobox/issues/comments/438359666","html_url":"https://github.com/octobox/octobox/issues/1110#issuecomment-438359666","issue_url":"https://api.github.com/repos/octobox/octobox/issues/1110","id":438359666,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODM1OTY2Ng==","user":{"login":"pradyunsg","id":3275593,"node_id":"MDQ6VXNlcjMyNzU1OTM=","avatar_url":"https://avatars1.githubusercontent.com/u/3275593?v=4","gravatar_id":"","url":"https://api.github.com/users/pradyunsg","html_url":"https://github.com/pradyunsg","followers_url":"https://api.github.com/users/pradyunsg/followers","following_url":"https://api.github.com/users/pradyunsg/following{/other_user}","gists_url":"https://api.github.com/users/pradyunsg/gists{/gist_id}","starred_url":"https://api.github.com/users/pradyunsg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pradyunsg/subscriptions","organizations_url":"https://api.github.com/users/pradyunsg/orgs","repos_url":"https://api.github.com/users/pradyunsg/repos","events_url":"https://api.github.com/users/pradyunsg/events{/privacy}","received_events_url":"https://api.github.com/users/pradyunsg/received_events","type":"User","site_admin":false},"created_at":"2018-11-13T17:26:50Z","updated_at":"2018-11-13T17:26:50Z","author_association":"CONTRIBUTOR","body":"Something else that would be useful would be time-based/age-based triggers - if a notification is older than 2 months days old, read and unstarred, delete it.\r\n"}}
{"actor":{"display_login":"pradyunsg"}}