This automation unassigns (deletes) all tasks in a project when the project phase changes to Archived. This is useful for keeping inactive projects clean and preventing old tasks from appearing in user task lists.
This Zap workflow is built using the following:
- Filevine "Project: Phase Changed" Trigger
- Filter step
- Filevine Custom "Get Project Tasks" API Request step
- Looping step
- Filevine Custom "Unassign Task" API Request step
Here's a screenshot of the entire Zap flow:
1. Trigger Step — Filevine "Project: Phase Changed"
First, login to your Zapier account, and create a new Zap. Choose Filevine as the app for the first step (trigger step) in your Zap. For more information on how to connect Zapier to Filevine, please see the following article: Connect Zapier to Filevine (Using PATs)
Once you've chosen Filevine as the app for the trigger step and setup your Filevine account info, press Continue or click on the Configure tab. We want to configure this Zap to run every time a project phase is changed in Filevine, and then we'll add a filter step to only handle the "Archived" phase. Configure the trigger step as follows:
- Event: Project: Phase Changed
- Load additional data?: Yes
Test the trigger and pull in a sample event. Note that you may need to go into your Filevine account and change a project's phase in order to be able to pull in sample data to work with when building out the Zap.
Here's a screenshot of the "Project: Phase Changed" trigger step:
2. Filter Step — Only Continue if Phase Name is Archived
We only want this automation to run when a project phase becomes Archived. To accomplish this, add a Filter step for Step 2 in your Zap, and configure it as follow:
- Data Project Phase Name (from step 1.)
- (Text) Exactly matches
- Archived
Here's a screenshot of the Config tab for the filter step after testing:
3. Get Filevine Project Tasks (Custom API Request Step)
Next, we need to retrieve all tasks associated with the project so we can loop through and unassign (delete) them. We will use the "Get Project Task List" endpoint via the API Request (Beta) action within the Filevine Zapier connector.
Create a new Filevine step for Step 3. in your Zap, choose the API Request (Beta) action, and configure the request settings as follows:
- Stop on Error: Yes
- HTTP Method: GET
-
Endpoint URL:
https://api.filevineapp.com/fv-app/v2/projects/<PROJECT_ID>/Tasks
Be sure to replace<Project ID>in the URL path with the dynamic value from the trigger step (Step 1). To do this, paste the Endpoint URL shown above into the URL field in your Zap step, then select the<Project ID>portion in the URL, and click the + icon on the right side of the URL box, type "Project ID" in the search box, and choose the:Project IDto replace the<Project ID>placeholder text with the dynamic Project ID from Step 1. - Query String Parameters: ❌ Leave this blank.
- Additional Headers: ❌ Leave this blank.
- Body: ❌ Leave this blank.
Here's a screenshot of the "Get Filevine Project Tasks" custom API Request:
Test your Zap to grab a list of tasks from the project in Filevine. Note that you may need to add and assign a new task in the project activity feed first in order to have sample data to finish building the Zap with.
4. Looping Step — Loop Over Each Filevine Project Task
Now that we have the list of tasks from the API response, we need to loop through each task and unassign (delete) it.
Create a new action for Step 4. in your Zap, and choose the "Looping" (by Zapier) action. For the Action event option, choose: "Create Loop From Line Items". Configure the Looping step as follows, where "Values to Loop" defines the variable(s) that will be iterated over in each loop run--where the left side is the variable name you choose, and the right side is the comma-separated list to iterate through:
-
Values to Loop:
taskId→ Response Data Items Note Id Native (from step 3.) - Trim Whitespace: True (leave as is)
- Loop iteration counter start: 1 (leave as is)
- Maximum number of Loop iterations: 500
Test the loop to generate the Task ID variable for using in the next step.
Here's a screenshot of the Looping step Configure tab:
5. Final Step — Unassign Task (Custom API Request Step)
Inside the loop, we will now unassign (delete) each task using another custom API request. We will use the "Unassign task" endpoint via the API Request (Beta) action within the Filevine Zapier connector.
Create a new Filevine step for Step 5. in your Zap, choose the API Request (Beta) action, and configure the request settings as follows:
- Stop on Error: Yes
- HTTP Method: DELETE
-
Endpoint URL:
https://api.filevineapp.com/fv-app/v2/tasks/<Task ID>
Be sure to replace<Task ID>in the URL path with the dynamic looping variable, "Task ID", from the Looping step (Step 4.) in your Zap. - Query String Parameters: ❌ Leave this blank.
- Additional Headers: ❌ Leave this blank.
- Body: ❌ Leave this blank.
Here's a screenshot of the "Unassign Task" custom API Request:
Testing your Zap will delete the first task in the list fetched from Step 3.
You can now Publish your Zap, and test out the whole flow by archiving a project in Filevine that has tasks in the project that are assigned to users. All tasks should be unassigned now once the project is archived.
References:
-
Filevine API v2 Endpoint Documentation
- Get Project Task List: https://filevine.stoplight.io/docs/v2-us/4c004ea45bd3f-get-project-task-list
-
Unassign Task: https://filevine.stoplight.io/docs/v2-us/29c304eb66bdb-unassign-task
-
Filevine-Zapier Connector Documentation:
- Setup Filevine and Create a PAT For Zapier: https://support.vineskills.com/hc/en-us/articles/38482462814861-Setup-Filevine-and-Create-a-PAT-For-Zapier
- Connect Zapier to Filevine (Using PATs): https://support.vineskills.com/hc/en-us/articles/35578443337997-Connect-Zapier-to-Filevine-Using-PATs
- Creating Custom API Requests in Filevine-Zapier: https://support.vineskills.com/hc/en-us/articles/36403841854349-Creating-Custom-API-Requests-in-Filevine-Zapier
Comments
0 comments
Please sign in to leave a comment.