Created
October 4, 2017 15:03
-
-
Save robhowlett/f2ccc9c91b808b79429436cbffee2f0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from jira import JIRA | |
| import csv | |
| # Instructions | |
| # ------------ | |
| # | |
| # 1. Create a CSV file with "Summary" and "Description" headers and fill out appropriately. | |
| # 2. Modify the varaibles in the lines below as appropriate | |
| # 3. Run the script | |
| csv_file = "XXX.csv" | |
| prepend_summary = "" | |
| append_summary = "" | |
| prepend_description = "" | |
| append_description = "" | |
| jira_server = "https://jira.XXX.com" | |
| jira_user_pass = ('USER','PASS') | |
| jira_project = "ABC" | |
| jira_issue_type = {'name': 'Task'} | |
| csvfile = open(csv_file, 'r') | |
| infra_tests = csv.DictReader(csvfile, delimiter=',', quotechar='"') | |
| jira = JIRA(jira_server, basic_auth=jira_user_pass) | |
| for row in infra_tests: | |
| summary = prepend_summary + row['Summary'] + append_summary | |
| description = prepend_description + row['Description'] + append_description | |
| new_issue = jira.create_issue(project=jira_project, | |
| summary=summary, | |
| description=description, | |
| issuetype=jira_issue_type) | |
| print "Created %s" % new_issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment