Agile Central - Webhooks: Can a webhook apply for multiple projects?

Document ID : KB000117615
Last Modified Date : 16/10/2018
Show Technical Document Details
Question:
Can we apply a webhook to trigger on multiple projects or is a webhook associated with just one project?
Answer:

There isn't a way to combine multiple projects on a single Webhook definition. You can not specify any project and then the Webhook will trigger on any given project. You can also specify one project for the Webhook, but there isn't a way to limit or confine a webhook to a specified number or names of multiple projects. In that situation, you will need to create a webhook for each project.

In order to trigger a webhook in the confines of a project you will have to use the "project" operator. This operator is explained our the Webhook API guide.

User-added image

Here is an example of how to use the 'project' operator:
 

"Expressions": [
    {
      "Operator": "project",
      "Value": "2b286e96-5ef8-443c-b630-dc2cdbf6fcd8"
    }
  ],

 

Webhooks have another operator: "~" which allows to specify a number of items in a comma delimited string to allow any of the values to meet the condition, but this operator is based on AttributeID or AttributeName and can not be applied using the 'project' special operator.

Furthermore, the set of expressions requires all expressions to match (so using 'and' between the expressions and not 'or'), so you can't combine a few 'Project' based expressions. From the documentation, see:

User-added image

So there isn't a way to combine expressions that are based on the 'project' operator in such a way that will have an 'OR' between them.

Therefore, if you need to confine a Webhook to more than one project (but not all) then you shall create a Webhook for each project using the 'project' operator and have the value set to the UUID of each project in each Webhook definition's expression. 

Additional Information:
- Check out the documentation on Webhooks.
- Check out the Webhook API.
- See this doc to learn how to locate an attribute ID (or UUID).