GithubHelp home page GithubHelp logo

vipsaran / youtrack-to-azure-devops-boards Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fuglede/youtrack-to-azure-devops-boards

0.0 0.0 0.0 9 KB

YouTrack to Azure DevOps issue migration

License: MIT License

Python 100.00%

youtrack-to-azure-devops-boards's Introduction

YouTrack to Azure DevOps issue migration

This project contains a script for migrating issues from YouTrack to Azure DevOps Boards. It can migrate issues from a given YouTrack project to a given Azure DevOps project. It supports migration of comments, attachments, and custom fields.

Example usage

All interfacing with Azure DevOps requires a personal access token granting read+write access to work items, and which we refer to as pat below:

from migrator import Migrator, SetFieldOperation

pat = 'wz13hy65okghxfuodbvk3tmkilefxnx6gret04sl1m0didiocept'  # Placeholder: Replace with your own PAT
yt_base = "https://my-youtrack-instance"
ado_organization = "https://dev.azure.com/organization-name"
ado_project = "project-name"
migrator = Migrator(pat, yt_base, ado_organization, ado_project)

With this, you may want to first get a list of available custom fields on a given YouTrack issue, say AB-123:

print(migrator.custom_fields('AB-123'))

These custom fields can then be used to define how to migrate a particular issue or YouTrack project; for instance, to move YouTrack fields 'Priority' and 'Estimation' to Azure DevOps fields 'Task Priority', 'Estimation', define a handler through

def custom_field_handler(fields):
    priority = fields["Priority"].get("name", "")
    yield SetFieldOperation("Task Priority", priority, False)

    estimation = fields["Estimation"].get("presentation", "")
    yield SetFieldOperation("Estimation", estimation, False)

Here, the keys 'name' and 'presentation' depend on the type of custom field and can be read from the output of migrator.custom_fields above.

Note that when using "Task" as work item type in Azure DevOps Boards, some fields, such as System.State and System.Reason can only be set after the work item has been created; for such fields, use True for the third parameter above.

With this, we can migrate a particular issue through

migrator.migrate_issue('AB-123', custom_field_handler)

or an entire project through

migrator.migrate_project('AB', custom_field_handler, issue_count_upper_limit=50000)

where here, number_of_issues is simply any number greater than the number of issues in the project.

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.