Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Sheet to Asana Sync #205

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Google Sheet to Asana Sync #205

wants to merge 3 commits into from

Conversation

mtuchi
Copy link
Collaborator

@mtuchi mtuchi commented Mar 26, 2024

Description

This PR is for a webhook trigger workflow that sync data between GoogleSheet and Asana

Details

I have created a Google App Script file named, codegs which has couple of functions that track changes in spreadsheet and Sync those changes to OpenFn webhook URL.

Behind the Scene

  • When a user update a cell in spreadsheet, we store the changes in a temporary JSON object
  • When the user is done with changes s/he can click the OpenFn ⚡️> Sync Now 🔄, a request will be sent to OpenFn with the latest changes. Then if successfully we clear the object that holds the latest changes
  • A workflow will be triggered on app.openfn.org, and will contain an object that have all the latest changes in form of key value pair Eg: {taskId: [ {activity: {}, values: {}]}
  • Also we have the ability to set a time based trigger that will sync the latest changes to OpenFn. See createDailyTrigger() function

Creating Task Comment

I have created a simple asana job that will use the incoming http request from Google Sheet, and create a map of comments to be sync for each task. See createTaskComment.js

Important Notes

The changes for creating task comments depends on new version of Asana adaptor which will be released here OpenFn/adaptors#495

Asana API Limitation for creating comments
The Asana API does not support bulk creation for task comments which means each comment creation = 1 API call
Eg: 5 comments = 5 API calls.

See screenshot below for an example 👇🏽
Screenshot 2024-03-27 at 3 53 09 PM

The current implementation tracks every changes that happen in each row which results into a lot of comments that needs to be created in Asana. This will potentially result into throttle errors from Asana since we will be making lots of requests.

A fix possible Fix
We sync only the latest changes of a row and not the entire history of a row

Ref #204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Sheets and Asana API exploration for new WCS work packages
1 participant