Subscribe Webhook to Project Status updates in a Portfolio?

Hi there,

I’d like to receive updates to project statuses for any project in a certain portfolio. Ideally I can create a webhook to consume these en masse vs. having to instantiate webhooks on a per-project basis.

However, when I subscribe to changes using the portfolio as the resource and filtering for changes to the resource_type of project, I don’t get updates to project status (e.g., it’ll just say that modified_at changed).

When I try to instantiate a webhook targeting the portfolio as the resource but filtering for changes to project_status, I get a 404.

Sample request:

{
	"data": {
		"resource": "myPortfolioGid",
		"target": "https://foobar.com/",
		"filters": [
			{
				"resource_type": "project_status"
			}
		]
	}
}

Response:

{
	"errors": [
		{
			"message": "The remote server which is intended to receive the webhook responded with an incorrect status code: 404",
			"help": "For more information on API status codes and how to handle them, read the docs on errors: https://developers.asana.com/docs/errors"
		}
	]
}

Any ideas if it’s possible to set up a webhook that gets updates about project status from a given portfolio w/o creating on a per-project basis?

Hi @William_Fry1 and welcome to the forum,

Unfortunately there’s no direct webhook support for project status updates.

I haven’t tried this myself but there was one person who was able to figure out how to get status updates via webhooks:

Hi @William_Fry1 , larger-scope resources such as portfolios are more limited in terms of the filters that can be applied to their entities. That said, for your specific goal of catching project status updates, I’d recommend subscribing to a webhook that tracks all project changes within a portfolio:

{
  data: {
    filters: [
      {
        action: "changed",
        resource_type: "project"
      }
    ],
    resource: "<PORTFOLIO_GID>",
    target: "<TARGET_URL>"
  }
}

On the consumer side, you can then filter events related to changes in the completed_at field. Such events will look like this:

{
  user: {
    resource_type: 'user',
    gid: '<USER_GID>'
  },
  change: {
    field: 'completed_at',
    action: 'changed'
  },
  resource: {
    resource_type: 'project',
    gid: '<PROJECT_GID>'
  }
}

I’ve verified that these updates are sent for every status change, including those that don’t actually set the completed_at value.

Hope it helps.

3 Likes

Amazing! Thank you, Mikhail

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.