Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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{taskId: [ {activity: {}, values: {}]}
createDailyTrigger()
functionCreating 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 👇🏽
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