简体   繁体   中英

Trello new card created/modified to google sheets

Trello provides api that can be integrated in google scripts so that if something happens in spreadsheet, we can create/modify cards in appropriate boards. Also zapier provides similar sort of integrations.

But is the reverse possible? ie if some new card gets created or modified, it gets pushed back to google sheet.

I could not find in their api if they have some sort of a listener that listens to card created/modified event(please correct me if I am wrong). So was thinking of alternative ways to do the same.

Here is a workaround:

  1. In the App Script Editor, drop down Publish menu and select Deploy as web app ...
  2. Set Who has access to the app to Anyone (this limits it to those who have logged in - ie Trello is not logged in).
  3. Add the webhook (this will now succeed).
  4. Go back to step 2 and this time set it to Anyone, even anonymous

Google Apps Scripts can be published as webapps. You can use the built in functions doGet() and doPost() to receive GET and POST events to your webapp. I haven't setup Trello specifically but I do use this to setup webhooks for github.

Here are the docs on pubishing your script as a web app
https://developers.google.com/apps-script/guides/web

The docs will state that you must return an htmlService or contentService object from a doPost() or doGet(). Most webhooks are looking for a response code, you can simply do a ' return 200; ' That works fine.

note: missing from the docs is how to access the post body.

function doPost(e){
 var postBody = e.postData.getDataAsString();
 // Do something with the postBody Data
 return 200;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM