Skip to content

Instantly share code, notes, and snippets.

@timtan
Created January 10, 2019 06:07
Show Gist options
  • Save timtan/ff05817fedea6d1b1284ca739d26c67e to your computer and use it in GitHub Desktop.
Save timtan/ff05817fedea6d1b1284ca739d26c67e to your computer and use it in GitHub Desktop.
import asana
asana_personal_token = "" # Personal Token
project_id = 0 # Project id
client = asana.Client.access_token(asana_personal_token)
def cumpute_days(section):
days = 0
for task in client.tasks.find_by_section(section):
task_id = task['id']
task_deatil = client.tasks.find_by_id(task_id)
for field in task_deatil[u'custom_fields']:
if field['name'] == 'Days' and field['number_value']:
days +=field['number_value']
return days
for section in client.sections.find_by_project(956418772713380):
name = section['name']
section_id = section['id']
print name
print cumpute_days(section_id)
@timtan
Copy link
Author

timtan commented Jan 10, 2019

pip install asana

@timtan
Copy link
Author

timtan commented Jan 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment