Created
December 10, 2018 08:54
-
-
Save kokosing/14afd2f307edb54c59bc4ff7f3712ec7 to your computer and use it in GitHub Desktop.
Create JIRA Releaase issues
This file contains 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 python3 | |
import argparse | |
import csv | |
import jira | |
parser = argparse.ArgumentParser(description='Create JIRA release epic branch issues.') | |
parser.add_argument('--file', metavar='file', type=str, help='Patches bookkeeping CSV file for releases') | |
parser.add_argument('--user', metavar='user', type=str, help='JIRA user') | |
parser.add_argument('--password', metavar='password', type=str, help='JIRA password') | |
parser.add_argument('--issue', metavar='issue', type=str, help='JIRA release issue') | |
args = parser.parse_args() | |
jac = jira.JIRA('https://starburstdata.atlassian.net', auth=(args.user, args.password)) | |
release_issue = jac.issue(args.issue) | |
issue_type = jac.issue_type_by_name('Task') | |
with open(args.file) as csvfile: | |
csvreader = csv.reader(csvfile) | |
for row in csvreader: | |
if row[0]: | |
summary = row[0] | |
title = summary.split('\n')[0] | |
description = "Change Master Copy (single source of truth): " + row[1] | |
upstream = row[2].strip() | |
if not upstream or upstream > '0.213': | |
print(f"{title} - {upstream}") | |
jac.create_issue( | |
summary=f"Rebase: {title}", | |
description=f"Rebase:\n{summary}\nSee: {description}\nPatches bookkeeping for releases - <PUT A LINK HERE>", | |
customfield_10008=args.issue, # set the epic link | |
project='PRESTO', | |
issuetype='Task', | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated version: