Unfortunately webhook filter’s for broader Asana data model entities like goals are more limited, so the working solution would be to subscribe to the broader events scope and then to filter out events which include creation of a goal relationship on the recipient side.
Using the goal relationship GID from here you can leverage the Get a goal relationship endpoint to retrieve the project.
Since goals may also hold tasks and portfolios, it will be also important to check that the added relationship actually is a project relationship by verifying the “resource_type” property:
@Mikhail_Melikhov Thank you for your answer! The method works, but is there any chance to track addition of goal relationships on workspace level? Cause I have >20 workspace level goals to track
Hi @Dmitry_Nikonov , I ran some experiments and, unfortunately, I wasn’t able to capture goal relationship events when subscribing at the workspace level webhooks.
That said, I’d suggest approaching this from the other direction. You can use the Get goals endpoint to retrieve the workspace’s goals (and filter out any that aren’t relevant to your use case). From there, you can poll those goals’ Events and watch for entries where "type": "goal_relationship" and "action": "added" are present.
I tested this approach and confirmed it’s working as expected. If your solution can accommodate a polling model, this should give you the functionality you need.