From f433c1cd4b809435595cfc96899a80513a76cf21 Mon Sep 17 00:00:00 2001 From: Alex Sickler Date: Tue, 27 Aug 2024 14:43:26 -0400 Subject: [PATCH] :sparkles: output ticket ids in json format --- d3b_dff_cli/modules/jira/create_ticket.py | 11 ++++++----- d3b_dff_cli/version.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/d3b_dff_cli/modules/jira/create_ticket.py b/d3b_dff_cli/modules/jira/create_ticket.py index 8c19657..7f2f6e1 100644 --- a/d3b_dff_cli/modules/jira/create_ticket.py +++ b/d3b_dff_cli/modules/jira/create_ticket.py @@ -315,8 +315,6 @@ def get_transfer_key(epic_key, headers, jira_url): query_data = json.loads(response.data) - print(query_url) - # loop through fields to find transfer ticket for issue in query_data["issues"]: if "Data Transfer - " in issue["fields"]["summary"]: @@ -352,13 +350,16 @@ def main(args): project_id, issue_type_id, fields, args.post, args.prd, args.jira_url, headers ) + output_json = None + if args.post: if args.issue_type == "Data Intake Epic": transfer_key = get_transfer_key(ticket_key, headers, args.jira_url) - print(f"Data Intake Epic ID: {ticket_key}") - print(f"Transfer Ticket ID: {transfer_key}") + output_json = {"Epic ID": ticket_key, "Transfer Ticket ID": transfer_key} else: - print(f"Ticket ID: {ticket_key}") + output_json = f"Ticket ID: {ticket_key}" + + print(json.dumps(output_json, indent=4, sort_keys=True)) return diff --git a/d3b_dff_cli/version.py b/d3b_dff_cli/version.py index afced14..3f39079 100644 --- a/d3b_dff_cli/version.py +++ b/d3b_dff_cli/version.py @@ -1 +1 @@ -__version__ = '2.0.0' +__version__ = '2.0.1'