Esempio n. 1
0
def update_issue(jira_host, username, password, issue_id, body):
    """
    Updates issue with the provided body.

    jira_host -- JIRA host to contact.
    username -- JIRA username with administrative permissions.
    password -- password of the username.
    issue_id -- id of the issue to update.
    body -- update body.
    """
    headers = get_auth_header(username, password)
    headers.update(get_content_type_header())
    response = https_helper.put(jira_host, issue_path % issue_id, body, headers)
    if response.status != 200:
        ValueError('Failed to update issue %s: %s %s' % (issue_id, response.status, response.reason))
Esempio n. 2
0
def update_version(jira_host, username, password, version_id, body):
    """
    Updates specific version.

    jira_host -- JIRA host to contact.
    username -- JIRA username with administrative permissions.
    password -- password of the username.
    version_id -- version which should be updated.
    body -- new version body.
    """
    headers = get_auth_header(username, password)
    headers.update(get_content_type_header())
    response = https_helper.put(jira_host, version_path % version_id, body, headers)
    if response.status != 200:
        raise ValueError('Failed to update version %s: %s %s' % (version_id, response.status, response.reason))
Esempio n. 3
0
def update_issue(jira_host, username, password, issue_id, body):
    """
    Updates issue with the provided body.

    jira_host -- JIRA host to contact.
    username -- JIRA username with administrative permissions.
    password -- password of the username.
    issue_id -- id of the issue to update.
    body -- update body.
    """
    headers = get_auth_header(username, password)
    headers.update(get_content_type_header())
    response = https_helper.put(jira_host, issue_path % issue_id, body,
                                headers)
    if response.status != 200:
        ValueError('Failed to update issue %s: %s %s' %
                   (issue_id, response.status, response.reason))
Esempio n. 4
0
def update_version(jira_host, username, password, version_id, body):
    """
    Updates specific version.

    jira_host -- JIRA host to contact.
    username -- JIRA username with administrative permissions.
    password -- password of the username.
    version_id -- version which should be updated.
    body -- new version body.
    """
    headers = get_auth_header(username, password)
    headers.update(get_content_type_header())
    response = https_helper.put(jira_host, version_path % version_id, body,
                                headers)
    if response.status != 200:
        raise ValueError('Failed to update version %s: %s %s' %
                         (version_id, response.status, response.reason))