Skip to content

Instantly share code, notes, and snippets.

@reverentgeek
Created March 16, 2021 14:22
Show Gist options
  • Save reverentgeek/939fda10e8cbeb6825ad7fc71e821053 to your computer and use it in GitHub Desktop.
Save reverentgeek/939fda10e8cbeb6825ad7fc71e821053 to your computer and use it in GitHub Desktop.
{
"$version": "2",
"api": {
"base_url": "https://app.asana.com/api/1.0"
},
"auth": {
"asana-auth": {
"type": "oauth2",
"configuration": {
"client_id": "{your-asana-client-id}",
"client_secret": "{your-asana-client-secret}",
"authorization_base_url": "https://app.asana.com/-/oauth_authorize",
"token_url": "https://app.asana.com/-/oauth_token",
"refresh_url": "https://app.asana.com/-/oauth_token",
"scopes": [
"default",
"profile"
]
}
}
},
"workflows": [
{
"name": "create-task-from-contact",
"label": "Create an Asana Task",
"description": "Create a Task in Asana",
"type": "automations",
"auth": "asana-auth",
"setup": {
"connect": {
"label": "Connect",
"describe_connection": {
"!pipe": [
{
"!http": {
"method": "GET",
"path": "/users/me",
"headers": {
"accept": "application/json"
}
}
},
{
"!jq": ".data | { account_id: .gid, description: .name, image_url: .photo.image_128x128 }"
}
]
}
},
"select": {
"label": "Asana Settings",
"form_fields": [
{
"label": "Select Project",
"id": "project_id",
"type": "dropdown",
"options": {
"!pipe": [
{
"!http": {
"method": "GET",
"path": "/projects",
"pagination": false
}
},
{
"!jq": "[.data[] | {display: .name, value: .gid}]"
}
]
}
},
{
"label": "Task Name",
"id": "task_name",
"type": "textarea",
"placeholder": "Name of the task",
"personalize": "ActiveCampaignContact"
},
{
"label": "Task Notes",
"id": "task_notes",
"type": "textarea",
"placeholder": "Detailed description of task",
"personalize": "ActiveCampaignContact"
}
]
}
},
"data_pipeline": {
"source": {
"!resource": "ActiveCampaignContact"
},
"target": {
"!pipe": [
{
"!http": {
"method": "POST",
"path": "/tasks",
"headers": {
"accept": "application/json"
},
"body": {
"data": {
"name": "${custom_data.task_name.value}",
"notes": "${custom_data.task_notes.value}",
"completed": false,
"projects": [
"${custom_data.project_id.value}"
]
}
}
}
}
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment