Exemplo n.º 1
0
def close_resolved_issues(jira_host, username, password, project_key, version_name):
    """
    Close all resolved issues of the specified project and version.

    jira_host -- host address of the JIRA instance to connect to.
    username -- JIRA username with administrative permissions.
    password -- JIRA user password.
    project_key -- key of the project, which issues should be closed.
    version_name -- name of the version, which issues should be closed.
    """
    search_query = 'jql=project=%s+AND+status=resolved+AND+fixVersion=%s&fields=id' % (project_key, version_name)
    for issue in jira_helper.get_issues(jira_host, search_query):
        jira_helper.close_issue(jira_host, username, password, issue['id'])
Exemplo n.º 2
0
def close_resolved_issues(jira_host, username, password, project_key, version_name):
    """
    Close all resolved issues of the specified project and version.

    jira_host -- host address of the JIRA instance to connect to.
    username -- JIRA username with administrative permissions.
    password -- JIRA user password.
    project_key -- key of the project, which issues should be closed.
    version_name -- name of the version, which issues should be closed.
    """
    search_query = 'jql=project=%s+AND+status=resolved+AND+fixVersion=%s&fields=id' % (project_key, version_name)
    for issue in jira_helper.get_issues(jira_host, search_query):
        jira_helper.close_issue(jira_host, username, password, issue['id'])
Exemplo n.º 3
0
def move_unresolved_issues(jira_host, username, password, project_key, version_from, version_to):
    """
    Change fixVersion of unresolved issues.

    jira_host -- host address of the JIRA instance to connect to.
    username -- JIRA username with administrative permissions.
    password -- JIRA user password.
    project_key -- key of the project, which issues should be updated.
    version_from -- version to filter unresolved issues.
    version_to -- new version of the unresolved issues.
    """
    search_query = 'jql=project=%s+AND+resolution=unresolved+AND+fixVersion=%s&fields=id' % (project_key, version_from)
    body = json.dumps({"fields": {"fixVersions": [{"name": version_to}]}})
    for issue in jira_helper.get_issues(jira_host, search_query):
        jira_helper.update_issue(jira_host, username, password, issue['id'], body)
Exemplo n.º 4
0
def move_unresolved_issues(jira_host, username, password, project_key, version_from, version_to):
    """
    Change fixVersion of unresolved issues.

    jira_host -- host address of the JIRA instance to connect to.
    username -- JIRA username with administrative permissions.
    password -- JIRA user password.
    project_key -- key of the project, which issues should be updated.
    version_from -- version to filter unresolved issues.
    version_to -- new version of the unresolved issues.
    """
    search_query = 'jql=project=%s+AND+resolution=unresolved+AND+fixVersion=%s&fields=id' % (project_key, version_from)
    body = json.dumps({"fields": {"fixVersions": [{"name": version_to}]}})
    for issue in jira_helper.get_issues(jira_host, search_query):
        jira_helper.update_issue(jira_host, username, password, issue['id'], body)
Exemplo n.º 5
0
def _get_blockers(config):
    q = 'jql=project={0}+AND+resolution=Unresolved+AND+fixVersion={1}+AND+priority=Blocker' \
        .format(config.project, config.version)
    return jira_helper.get_issues(config.host, q)
Exemplo n.º 6
0
def _get_blockers(config):
    q = 'jql=project={0}+AND+resolution=Unresolved+AND+fixVersion={1}+AND+priority=Blocker' \
        .format(config.project, config.version)
    return jira_helper.get_issues(config.host, q)