Skip to content

Commit 67df6e9

Browse files
committed
add reporter_id as argument
1 parent eacbd26 commit 67df6e9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

abr-testing/abr_testing/automation/jira_tool.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def create_ticket(
122122
summary: str,
123123
description: str,
124124
project_key: str,
125+
reporter_id:str,
125126
issue_type: str,
126127
priority: str,
127128
components: list,
@@ -135,7 +136,7 @@ def create_ticket(
135136
"issuetype": {"name": issue_type},
136137
"summary": summary,
137138
"reporter": {
138-
"accountId": "712020:f32d03f8-f91a-465d-871b-45135b7b955f"
139+
"id": reporter_id
139140
},
140141
"parent": {"key": robot},
141142
"priority": {"name": priority},
@@ -222,6 +223,14 @@ def post_attachment_to_ticket(self, issue_id: str, attachment_path: str) -> None
222223
nargs=1,
223224
help="Email connected to JIRA account.",
224225
)
226+
# TODO: write function to get reporter_id from email.
227+
parser.add_argument(
228+
"reporter_id",
229+
metavar="REPORTER_ID",
230+
type=str,
231+
nargs=1,
232+
help="JIRA Reporter ID."
233+
)
225234
# TODO: improve help comment on jira board id.
226235
parser.add_argument(
227236
"board_id",
@@ -237,7 +246,7 @@ def post_attachment_to_ticket(self, issue_id: str, attachment_path: str) -> None
237246
api_token = args.jira_api_token[0]
238247
email = args.email[0]
239248
board_id = args.board_id[0]
240-
249+
reporter_id = args.reporter_id[0]
241250
ticket = JiraTicket(url, api_token, email)
242251
error_runs = get_error_runs_from_robot(ip)
243252
one_run = error_runs[-1] # Most recent run with error.
@@ -257,6 +266,7 @@ def post_attachment_to_ticket(self, issue_id: str, attachment_path: str) -> None
257266
summary,
258267
whole_description_str,
259268
project_key,
269+
reporter_id,
260270
"Bug",
261271
"Medium",
262272
components,

0 commit comments

Comments
 (0)