I would like to have an automation in place to update a task's status based on filters related to the deal that the task is associated to. I tried looking online in the Hubspot forums, but there was nothing in the native Hubspot functionality that would allow this to happen. I tried using the Make integration in order to do a search function with the API to find the tasks, but I don't think I was able to set it up correctly as I do not really have any experience coding.
Filters are: Task status does not equal "Completed" Task title contains: "Follow Up" or "Follow-Up" Associated deal Close date is known Associated deal stage contains any of "Closed", "closed", "Lost", "lost", "Won", or "won"
Here is the code that I am currently running for the search function as the first step, but I don't know if the problem is this first step being coded incorrectly or the subsequent steps after that is causing the problem. Any help would be appreciated.
Step 1: API Call
URL: /crm/v3/associations/deals/tasks/batch/associate/default Method: POST Body:
{
"limit": "5"
"properties": [
"Task_title",
"Assigned_to",
"Primary_Deal_ISR",
"Deal_Pipeline",
"Deal_Stage"
],
"filterGroups": [
{
"filters": [
{
"propertyName": "Task_status",
"operator": "NEQ",
"value": "Completed"
},
{
"propertyName": "Task_title",
"operator": "IN",
"value": ["Follow Up", "Follow-Up"]
},
{
"propertyName": "associations.deal.Close_date",
"operator": "HAS_Property"
},
{
"propertyName": "associations.deal.Deal_stage",
"operator": "IN",
"value": ["Closed", "closed", "Lost", "lost", "Won", "won"]
},
]
}
]
}
Step 2: Repeater
Initial value: 0 Repeats: {{if(module1.body.total = null; 1; module1.body.total / 100)}} Step: {{ifempty(module1.body.paging.next.after; 100)}}
Step 3: Sleep
Delay: 5
Step 4: API Call
URL: /crm/v3/associations/deals/tasks/batch/associate/default Method: POST Body:
{
"limit": "5"
"properties": [
"Task_title",
"Assigned_to",
"Primary_Deal_ISR",
"Deal_Pipeline",
"Deal_Stage"
],
"filterGroups": [
{
"filters": [
{
"propertyName": "Task_status",
"operator": "NEQ",
"value": "Completed"
},
{
"propertyName": "Task_title",
"operator": "IN",
"value": ["Follow Up", "Follow-Up"]
},
{
"propertyName": "associations.deal.Close_date",
"operator": "HAS_Property"
},
{
"propertyName": "associations.deal.Deal_stage",
"operator": "IN",
"value": ["Closed", "closed", "Lost", "lost", "Won", "won"]
},
]
}
]
"after": "{{module2.i}}"
}
Step 5: Iterator
Array: {{module4.body.results}}
Step 6: Final API Call to actually update task status
?