Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions dev/create_orc_jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run_cmd(cmd):

import argparse

def create_jira_issue(title, parent_jira_id=None, issue_type=None, version=None):
def create_jira_issue(title, parent_jira_id=None, issue_type=None, version=None, component=None):
asf_jira = jira.client.JIRA(
{"server": JIRA_API_BASE},
token_auth=JIRA_ACCESS_TOKEN,
Expand All @@ -76,6 +76,9 @@ def create_jira_issue(title, parent_jira_id=None, issue_type=None, version=None)
'versions': [{'name': affected_version}],
}

if component:
issue_dict['components'] = [{'name': component}]

if parent_jira_id:
issue_dict['issuetype'] = {'name': 'Sub-task'}
issue_dict['parent'] = {'key': parent_jira_id}
Expand Down Expand Up @@ -117,14 +120,15 @@ def main():
parser.add_argument("-p", "--parent", help="Parent JIRA ID for subtasks")
parser.add_argument("-t", "--type", help="Issue type to create when no parent is specified (e.g. Bug). Defaults to Improvement.")
parser.add_argument("-v", "--version", help="Version to use for the issue")
parser.add_argument("-c", "--component", help="Component for the issue")
args = parser.parse_args()

if args.parent:
print("Creating a subtask of %s with title: %s" % (args.parent, args.title))
else:
print("Creating JIRA issue with title: %s" % args.title)

jira_id = create_jira_issue(args.title, args.parent, args.type, args.version)
jira_id = create_jira_issue(args.title, args.parent, args.type, args.version, args.component)
print("Created JIRA issue: %s" % jira_id)

create_and_checkout_branch(jira_id)
Expand Down
Loading