Here is the Python code to search/open issues in JIRA:
- Search for open issues
- Create new issue
from jira import JIRA class JIRARestAPI: url = 'https://<company-name>.atlassian.net' username = '<username>' password = '<password>' jira = JIRA(url, basic_auth=(username, password)) def search_issues(self, search_string): return JIRARestAPI.jira.search_issues(search_string) def print_bugs(self, bugs): for bug in bugs: self.print_bug(bug) def print_bug(self, bug): print ("%s, %s, \"%s\"" % (bug.key, bug.fields.status.name, bug.fields.summary)) def create_cyg_bug(self, summary, description, label): issue_dict = { 'project': {'id': 10000}, 'summary': summary, 'description': description, 'issuetype': {'name': 'Bug'}, 'labels': [label] } return JIRARestAPI.jira.create_issue(fields=issue_dict)
No comments:
Post a Comment