Giter Site home page Giter Site logo

Comments (3)

makeplane avatar makeplane commented on August 23, 2024

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.

danstis avatar danstis commented on August 23, 2024

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.

TinyDB on PyPI

from ado-asana-sync.

makeplane avatar makeplane commented on August 23, 2024

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:

  1. Authentication: Ensure that you have API access tokens and necessary permissions for both Azure DevOps and Asana. Store them securely.

  2. 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.

  3. 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:

  1. 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.

  2. 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.

  3. 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.

  4. 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).

  5. 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.

  6. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.