コード例 #1
0
    def get_project_versions(self, project_key):
        url = JIRA_API_URL + 'project/' + project_key + '/versions'
        result = make_http_request(url, headers=self.get_headers())
        if not result:
            raise JiraConnectionError

        try:
            return json.loads(result)
        except JSONDecodeError:
            raise JiraError
コード例 #2
0
    def get_issue(self, key):
        url = JIRA_API_URL + 'issue/' + key

        result = make_http_request(url, headers=self.get_headers())
        if not result:
            raise JiraConnectionError

        try:
            issue = json.loads(result)
        except JSONDecodeError:
            raise JiraError
        else:
            return issue
コード例 #3
0
    def get_my_permissions(self):
        url = JIRA_API_URL + 'mypermissions'
        result = make_http_request(url, headers=self.get_headers())
        if not result:
            raise JiraConnectionError

        try:
            data = json.loads(result)
            permissions = data['permissions']
        except (JSONDecodeError, KeyError, TypeError):
            raise JiraError
        else:
            return permissions
コード例 #4
0
ファイル: bitbucket_api.py プロジェクト: R0gnar/release_maker
    def get_project_repos(self, project):
        url = BITBUCKET_API_URL + 'projects/' + project + '/repos?limit=1000'
        result = make_http_request(url, headers=self.get_headers())
        if not result:
            raise BitbucketConnectionError

        try:
            data = json.loads(result)
            repositories = data['values']
        except (JSONDecodeError, KeyError):
            raise BitbucketError
        else:
            return repositories
コード例 #5
0
ファイル: bitbucket_api.py プロジェクト: R0gnar/release_maker
    def get_commits(self, project, repo, params):
        query = urlencode(params)
        url = BITBUCKET_API_URL + 'projects/' + project + '/repos/' + repo + '/commits?' + query
        result = make_http_request(url, headers=self.get_headers())
        if not result:
            raise BitbucketConnectionError

        try:
            data = json.loads(result)
            commits = data['values']
        except (JSONDecodeError, KeyError):
            raise BitbucketError
        else:
            return commits
コード例 #6
0
    def get_issues(self, jql):
        url = JIRA_API_URL + 'search'
        query = urlencode({'jql': jql, 'maxResults': 100000})

        result = make_http_request(url + '?' + query,
                                   headers=self.get_headers())
        if not result:
            raise JiraConnectionError

        try:
            data = json.loads(result)
            issues = data['issues']
        except (JSONDecodeError, KeyError):
            raise JiraError
        else:
            return issues