Skip to content

Instantly share code, notes, and snippets.

@gjyoung1974
Created February 5, 2020 01:13
Show Gist options
  • Save gjyoung1974/0766c9f6a21455a8cd70eb9b819f2cf9 to your computer and use it in GitHub Desktop.
Save gjyoung1974/0766c9f6a21455a8cd70eb9b819f2cf9 to your computer and use it in GitHub Desktop.
#!/bin/env python3
from jira import JIRA
# Get these from ENV
user = "gordon.young@"
token = ""
jira_url = 'https://x.atlassian.net'
jira = JIRA(server=jira_url, basic_auth=(user, token))
# # Find all issues reported by Gordon
# issues = jira.search_issues("assignee='Gordon Young'AND status='In Progress'")
#
# for issue in issues:
# print(str(issue) + ", " + str(issue.fields.assignee))
# Create a DICT for each forseti finding object
issue_dict = {
'project': {'id': 14648},
'summary': 'New issue from jira-python',
'description': 'Gordon Creating a bug',
'issuetype': {'name': 'Bug'},
}
new_issue = jira.create_issue(fields=issue_dict)
print(new_issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment