Gå till vår prissättningssida för mer information.
För organisationer som använder Asanas Tidrapporter och Budgetar är periodisk rapportering avgörande för korrekt bokföring och löneadministration. Även om Asana erbjuder robusta vyer i appen kan du ibland behöva en omfattande CSV-export av alla tidsangivelser i hela din domän för extern revision eller anpassad bearbetning i slutet av en månad eller ett kvartal.
Den här artikeln förklarar hur du använder Asana API för att samla tidsposter från hela arbetsytan och formatera dem till en tydlig CSV-fil som är redo för redovisning och som uppfyller dina interna krav.
Anteckning
Den här guiden är skräddarsydd för användare av tillägget Tidrapporter och budgetar, men den API-baserade exportmetoden är också tillgänglig för användare som inte använder tillägget och som loggar tid via Asanas standarduppgiftsfält.
Asana-användargränssnittet erbjuder kraftfulla paneler, men genom att exportera via API kan du göra följande:
För att säkerställa kompatibilitet med standardiserade redovisningsmetoder bör ditt exportskript producera en CSV-fil som innehåller följande fält, så som de visas i dina exporter för granskningsvyn:
Kolumn | Beskrivning |
Uppgiftsnamn | Titeln på uppgiften där tiden loggades. |
Tid (timmar) | Total varaktighet konverterad från minuter till decimaltimmar. |
Datum | Den specifika dagen då arbetet utfördes. |
Inlämnare | Namnet på teammedlemmen som loggade tiden. |
Uppgiftens GID | Den unika identifieraren för Asana-uppgiften. |
Projekt-GID | Den unika identifieraren för det överordnade projektet. |
Uppgiftsstatus | Om uppgiften för närvarande är "Öppen" eller "Slutförd". |
GID för noteringen | Den unika identifieraren för den specifika tidsloggen. |
För att exportera ”all” tid måste ditt skript iterera genom dina projekt för att hitta uppgifter och sedan hämta tidsposter för dessa uppgifter med hjälp av slutpunkten Hämta tidsspårningsangivelser för en uppgift.
Pythonimport asanaimport pandas as pd# Initiera klientclient = asana.Client.access_token('YOUR_PERSONAL_ACCESS_TOKEN')workspace_gid = 'DIN_ARBETSYTAS_GID'def export_domain_time():all_time_data = []# 1. Iterera genom alla projekt i arbetsytanprojects = client.projects.get_projects({'workspace': workspace_gid})för projekt i projekt:# 2. Hämta alla uppgifter för projektetuppgifter = client.tasks.get_tasks_for_project(project['gid'], opt_fields=['name', 'gid', 'slutförd', 'completed_at', 'prioritet'])for task in tasks:# 3. Hämta tidsangivelser för varje uppgifttime_entries = client.time_tracking_entries.get_time_tracking_entries_for_task(task['gid'],opt_fields=['created_by.name', 'duration_minutes', 'entered_on', 'gid'])for entry in time_entries:# Beräkna timmar i decimalformathours = round(entry['duration_minutes'] / 60, 2)# Skapa raden så att den matchar CSV-mallenall_time_data.append({"Uppgiftsnamn": task['name'],"Tid (timmar)": hours,"Datum": entry['entered_on'],"Inlämnare": entry['created_by']['name'],"Uppgiftens GID": task['gid'],"Projekt-GID": project['gid'],"Uppgiftsstatus": "Slutförd" if task['completed'] else "Öppen","Uppgiftens slutförandedatum": task.get('completed_at', ''),"Uppgiftsprioritet": task.get('priority', ''),"GID för införande": entry['gid']})# 4. Spara till CSVdf = pd.DataFrame(all_time_data)df.to_csv('asana_time_export_accounting.csv', index=False)print("Export slutförd: asana_time_export_accounting.csv")export_domain_time()
När du kör den här exporten för en hel organisation bör du ha följande bästa praxis i åtanke:
Anteckning
This article has been AI-translated.
Send translation feedback.

These cookies are strictly necessary to provide you with certain features. For example, these cookies allow you to access secure areas that require registration and set your privacy preferences. Because these cookies are essential to providing services to you, they cannot be disabled. You can set your browser to block or alert you about these cookies, but it may cause some parts of the site to not work.
Third party trackers collect information used for analytics and to personalize your experience with targeted ads. Under the Virginia Consumer Data Protection Act, you have the right to opt-out of the sale of your personal data to third parties. You also have the right to opt out of targeted advertising related processing. You may exercise your right to opt out of the sale of personal data and targeted advertising by using this toggle. If you opt out, we will not be able to offer you personalized ads and we will stop sharing your personal information with third parties. For more information please see our Privacy Statement.
These cookies allow us or our third-party analytics providers to collect information and statistics on use of our services by you and other visitors. This information helps us to improve our services and products for the benefit of you and others.
These cookies, provided by our third-party advertising partners, collect information about your browsing habits, as well as your preferences for various features and services. They also provide us with auditing, research, and reporting to know when advertising content has been displayed and how successful the content has been. This information allows us and our third-party advertising providers to display relevant advertising content.
These cookies provide enhanced functionality, providing chat support, allowing you to more easily complete forms, personalizing content to your preferences, and selecting your communications preferences. If you do not enable these cookies, or choose to disable them in the future, that could impact your ability to use certain features.