Hi, I have created a webhook with “action”: “added” and “resource_type”: “task”, so that whenever a new task or subtask is created this webhook will get triggered. The unusual behavior is that when I click on the mark complete button of a task, the same webhook is getting triggered I don’t know why. Is this an unusual behavior?
Hi @Tarun2 and welcome to the forum,
(FYI I moved your post to the Developers & API forum section.)
That behavior does seem odd. Have you examined the whole webhook response to confirm that it’s the task
object being returned as having been “added”?
@Frederic_Malenfant any insights here? Or @John_Baldo @John_Vu?
We don’t use webook in Bridge24 (but we should!), but if the webhook is trigerred when task is completed, even if defined on action “added”, that is very strange.
My guess is, another webhook have been created to test something else, that that one is triggered.
Hi @Tarun2,
I was not able to reproduce this issue on my end.
Here’s what my webhook request body looks like for making a request to Establish a webhook:
{
"data": {
"resource": "<PROJECT_GID>",
"target": "<TARGET_URL>",
"filters": [
{
"resource_type": "task",
"action": "added"
}
]
}
}
I tested the following scenarios:
- Create a task in the project → Event gets emitted (EXPECTED)
- Create a subtask on a task in the project → Event gets emitted (EXPECTED)
- Marked subtask on a task in a project as completed → No events emitted (EXPECTED)
- Marked a task as complete in the project → No events emitted (EXPECTED)
I think @Frederic_Malenfant might be right.
Do you perhaps have another webhook established under the same webhook target URL that could be capturing those task marked as completed events? Try making a call to the Get multiple webhooks and see if there are any conflicting webhooks (i.e., webhooks that are using the same Target URL).
If you don’t see any other webhooks using the same target URL then it could be possible that another Personal Access Token was used to establish a webhook under that same target URL which means that if I have two personal access tokens PERSONAL_ACCESS_TOKEN_A
and PERSONAL_ACCESS_TOKEN_B
and establish a webhook with the same target URL across these two tokens and call Get multiple webhooks using PERSONAL_ACCESS_TOKEN_A
I won’t be able to see the webhook created by PERSONAL_ACCESS_TOKEN_B
and vice versa.
Ooops, I forgot!
I meant to tag @JFrentz, I know they use webhooks.
Hi all, below is the webhook I configured to create tasks. But it is also getting triggered when I am marking a task as complete. This is the only webhook I configured but yet…
{
"data": {
"filters": [
{
"action": "added",
"resource_type": "task"
}
],
"resource": "<project gid>",
"target": "<end point url>"
}
}
I am not sure why you are not able to recreate it. Can you help me out with this.