Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support bitbucket priorities #135

Open
sapr9x3 opened this issue Jan 30, 2021 · 0 comments
Open

Support bitbucket priorities #135

sapr9x3 opened this issue Jan 30, 2021 · 0 comments

Comments

@sapr9x3
Copy link

sapr9x3 commented Jan 30, 2021

Hello.
I was thinking about that is not a bad idea to have an ability to migrate isuues priorities from bitbucket to github.
I did it.
I made labels in my github repository: prio:trivial, prio:minor, prio:major, prio:critical, prio:blocker.

Then I just added to config.py

# We map bitbucket's issue "priority" to github "labels".
PRIORITY_MAPPING = {
    "trivial": "prio:trivial",
    "minor": "prio:minor",
    "major": "prio:major",
    "critical": "prio:critical",
    "blocker": "prio:blocker"
}

and to bitbucket_issues_to_github.py

def map_bpriority_to_glabels(bissue, glabels):
    bpriority = bissue['priority']
    if bpriority in config.PRIORITY_MAPPING:
        glabels.add(config.PRIORITY_MAPPING[bpriority])
...
...
def patch_gissue(gissue, bissue, bexport):
    if gissue['title'] != bissue['title']:
        raise ValueError('Inconsistent issues')

    glabels = set()
    map_bkind_to_glabels(bissue=bissue, glabels=glabels)
    map_bstatus_to_glabels(bissue=bissue, glabels=glabels)
    map_bpriority_to_glabels(bissue=bissue, glabels=glabels)  # <-this  

    gissue_patch = {
        "body": construct_gissue_content(bissue=bissue, bexport=bexport),
        "assignees": map_bassignee_to_gassignees(bissue=bissue),
        "labels": list(glabels),
        "state": map_bstatus_to_gstate(bissue=bissue),
    }
...

I can make a PR if this idea is really good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant