Comments (3)
Will require some kind of mapping of task IDs. Either a DB to retain the mapping, or use a field to store the mapped items.
from ado-asana-sync.
Potentially use TinyDB or the built in SQLite if not using a server. If we are happy with a server then MongoDB in a container.
from ado-asana-sync.
Creating a sync logic between two services can be intricate, but it's certainly doable. Here's a high-level approach to syncing tasks from Azure DevOps (ADO) boards to an Asana workspace:
Preliminary Setup:
Authentication: Ensure that you have API access tokens and necessary permissions for both Azure DevOps and Asana. Store them securely.
Define Mapping: Determine how attributes in ADO will map to Asana. For instance, a user story in ADO might map to a task in Asana. Ensure every ADO attribute has a corresponding Asana attribute.
Sync Database: Set up a local database to track synced items. For each ADO item:
ADO Item ID
Asana Item ID
Last Synced Timestamp
Sync Logic:
Fetching from ADO:
Connect to ADO using its REST API.
Retrieve all items assigned to the user that you wish to sync (use filters or queries).
For each item, check the local sync database to see if it's already synced.
If it's a new item, proceed to create a new task in Asana.
If it's an existing item, check the last updated timestamp in ADO against the "Last Synced Timestamp" from the local database.
Pushing to Asana:
For each new ADO item:
Create a new task in Asana using its attributes.
Store the new Asana task ID and the ADO item ID in the local sync database, along with the current timestamp.
For each existing ADO item:
If the ADO item's last updated timestamp is newer than the "Last Synced Timestamp" from the local database, update the corresponding Asana task with the changed attributes.
Update the "Last Synced Timestamp" in the local database for that item.
Error Handling:
Make sure to handle API rate limits, failed requests, and other potential issues.
If an item fails to sync, log the error, and consider setting up a retry mechanism.
Reverse Sync (Optional):
Depending on your needs, you might also want to sync updates from Asana back to ADO. If so, the logic would be similar but in reverse. Keep in mind this adds complexity because you need to handle conflicts (e.g., if an item is updated in both ADO and Asana before a sync occurs).
Scheduling:
Determine how often you want the sync to happen.
You can run the sync as a cron job or scheduled task.
Alternatively, consider using webhooks if supported. For instance, ADO can notify your app whenever an item changes, making the process more real-time.
Optimization:
Over time, you might retrieve a large number of items from ADO. Use filters or queries to limit the items to only those that have changed since the last sync, or those that are relevant based on other criteria (e.g., items in a particular state).
Regularly review and clean the sync database to remove old entries that are no longer relevant.
This is a high-level overview, and the specifics can get complex, especially when dealing with different attributes, error handling, rate limits, etc. Still, this should provide a foundational approach to get you started. Ensure to read the documentation for both ADO and Asana's APIs to understand the specifics of querying, creating, and updating items.
from ado-asana-sync.
Related Issues (20)
- Sync on a schedule
- Add error handling when a project can not be found by name
- Handle the closed states as a variable configuration item
- Add "Done" to the closed states
- Move helper functions to new utils package
- Break the sync package into smaller packages/modules
- Add application monitoring to the app HOT 1
- Removal of old tasks is failing HOT 1
- Duplicated sync tags HOT 1
- Function "builtins.any" is not valid as a type in ado_asana_sync\utils\utils.py
- Improve coverage of tests in task_item module
- Add sync of Pull Requests HOT 1
- Add multi-threading to the sync process HOT 1
- Tag is passed around as a string type containing the GUID of the tag
- Make sync sleep time a configuration variable
- Synced tag is not re-added to existing tasks if the tag is deleted and re-created
- Add details of updates in the comments of the task in Asana
- Investigate adding pydantic to enforce types
- Change the data source used to get the work items
- Handle empty application insights key to turn telemetry off HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ado-asana-sync.