Share Google Tasks lists with other users
This script needs to run inside a new Google Apps Script project. All data and permissions are tied to that project. Data is never shared with anyone except Google and the group of users of that specific, newly created project. Use at your own risk and only if you understand the consequences.
-
Copy the contents of Code.gs into the editor, replacing the existing content
-
On the first line, replace My Shared Tasks with the name of the Google Tasks list you want to turn into a shared list and save
-
In the menu on the left-hand side, click on the plus symbol next to Services, highlight Tasks API and add
-
For each user you want to have access to your list, enter their email address. Change the permission from Editor to Viewer
-
Click on Add Trigger
-
Select the following options
-
Choose which function to run: taskSync
-
Choose which deployment should run: Head
-
Select event source: Time-driven
-
Select type of time based trigger: Minutes timer
-
Select minute interval: Every 5 minutes
-
Failure notification settings: Notify me weekly
-
-
Save and in the pop up, select your account, click on Advanced and then Go to [Your Project Name] (unsafe)
-
If you feel confident in giving this script access to your Google Tasks account, click Allow
-
Tell each of your collaborators to perform steps 7 to 11 on their end. You can point them to the right menu by copying the URL from the address bar of your browser
-
All done! Everyone who granted access to their account should now see the shared list anywhere they can access Google Tasks
Read the announcement on my blog
-
If task’s due date is set, only the date part is synchronised, not the time of day. Google doesn't expose this information through the API
-
For the same reason, repeating tasks are not synchronised correctly. Only the initial due date is set
-
Merge conflicts are resolved by choosing the most recent version. See the example below
User A User B 00:01
🍎00:01
🍎00:02
Replace(🍎, 🍐)00:03
Replace(🍎, 🍊)00:04
🍐00:04
🍊00:05
taskSync()00:06
taskSync()00:07
🍐00:07
🍊00:08
taskSync()00:09
taskSync()00:10
🍊00:10
🍊
The tests in Tests.gs can be performed from a single user account. Synchronisation is simulated by creating temporary lists which are deleted once no longer needed.