Webhook missing "added" user information for "project" resource event

Hello,

I’ve been having a tough time trying to setup events to listen for all users that has been added as a follower at the project and task level. I’ve almost achieved it using the payload in the attached image below.

Below is an example of the event I’ve received from adding a user to a project.

{‘user’: {‘gid’: ‘XXXXX5928’, ‘resource_type’: ‘user’}, ‘created_at’: ‘2020-11-05T03:19:19.409Z’, ‘action’: ‘added’, ‘resource’: {‘gid’: ‘XXXXXXX0568’, ‘resource_type’: ‘project_membership’}, ‘parent’: {‘gid’: ‘XXXXXX5685’, ‘resource_type’: ‘project’}}

Also noting that adding a user for tasks contains the “added” user information so that’s fine. My goal is to verify users being added to projects/tasks using a “whitelist” then removing them, if not on the list, from the respective project/task afterwards. If there is a better way or if I’m missing something to listen for followers being added at the project level or even a better way to implement my goal, I’m all ears! Thanks.

I actually figured it out and it seems that “project_membership” did in fact give me the right information… I just needed to use the project membership ID given to me and hit the project membership API to retrieve the user information then use that information to hit the task API to remove the user. It doesn’t feel too good somehow but at least I can achieve what I needed. If there is anyone has a better solution to this, feel free to comment! :slight_smile:

1 Like