Would love to know if it is possible to use the Script Block for something like this - basically, send a record to an Asana Board and create a ticket with certain fields.
Is that possible?
Would love to know if it is possible to use the Script Block for something like this - basically, send a record to an Asana Board and create a ticket with certain fields.
Is that possible?
Best answer by JonathanBowen
Hi Hal,
You can send a new record (or new record in view) to Asana using Zapier (Airtable zapier triggers here). However, note that this will not sync the airtable record in Asana (e.g. changes to the record will not be reflected in Asana or vice-versa).
I’m not very familiar with Asana but if they have an API you could periodically sync between Airtable and Asana using something like Parabola or scripting block (this would be manually triggered).
Best
Aron
Want to learn Airtable? Join me for a webinar at airtable.com/webinar
Hi @Hal_Atkins - yes you can use the scripting block to create records in Asana using their API. Here’s a basic skeleton script:
let url = 'https://app.asana.com/api/1.0/tasks';
let headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
};
let myData = {
"data": {
"name": "Test task",
"projects": [
"YOUR_PROJECT_ID"
]
}
}
let apiResponse = await fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(myData),
})
let data = await apiResponse.json();
console.log(data);
You’ll notice that there’s no interaction with your base in this script, so that’s obviously something you’ll need to do, i.e. define a table, query a table, iterate through the records and so on. This script was just to prove you could do a POST request from the scripting block to Asana and create the task. There’s a lot more to the Asana API too - assignees, due dates, parent tasks etc, so all of this could be added in as needed to the data object.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.