diff --git a/liferay/apps/create_test_fix_ticket.py b/liferay/apps/create_test_fix_ticket.py index d5e430f..0c01ca2 100644 --- a/liferay/apps/create_test_fix_ticket.py +++ b/liferay/apps/create_test_fix_ticket.py @@ -19,9 +19,9 @@ def add_test_fix_ticket( ): print("Creating the Jira ticket...") - if project_key == "LPS": + if project_key == "LPD": issue_dict = { - "project": {"key": "LPS"}, + "project": {"key": "LPD"}, "summary": "Investigate failure in " + case_name, "description": "*Error Message*\n\n{code:java}" + case_error @@ -33,7 +33,8 @@ def add_test_fix_ticket( + case_result_id + "]", "components": [{"name": component}], - "issuetype": {"name": "Task"}, + "issuetype": {"name": "Testing"}, + "customfield_10383": {"value": "Analysis"}, } elif project_key == "LRQA": issue_dict = { @@ -51,37 +52,6 @@ def add_test_fix_ticket( "components": [{"name": component}], "issuetype": {"name": "Test Analysis"}, } - elif project_key == "LRAC": - issue_dict = { - "project": {"key": "LRAC"}, - "summary": "Investigate failure in " + case_name, - "description": "*Error Message*\n\n{code:java}" - + case_error - + "{code}\n\n*Affect Tests*\n[" - + case_name - + "|" - + TESTRAY_INSTANCE - + "/home/-/testray/case_results/" - + case_result_id - + "]", - "components": [{"name": component}], - "issuetype": {"name": "Task"}, - } - elif project_key == "COMMERCE": - issue_dict = { - "project": {"key": "COMMERCE"}, - "summary": "Investigate failure in " + case_name, - "description": "*Error Message*\n\n{code:java}" - + case_error - + "{code}\n\n*Affect Tests*\n[" - + case_name - + "|" - + TESTRAY_INSTANCE - + "/home/-/testray/case_results/" - + case_result_id - + "]", - "issuetype": {"name": "Task"}, - } return jira_connection.create_issue(fields=issue_dict) @@ -117,9 +87,6 @@ def get_case_result(auth, case_result_id): def get_relevant_jira_component(case_result, jira_connection, project_key): - if project_key == "COMMERCE": - return - print("Matching the Jira component...") jira_components = get_project_components(jira_connection, project_key) @@ -131,15 +98,12 @@ def get_relevant_jira_component(case_result, jira_connection, project_key): components = [n for n in jira_component_names if testray_component_name in n] if len(components) == 0: - if project_key == "LPS": + if project_key == "LPD": components = ["Testing > Portal"] elif project_key == "LRQA": components = ["Portal"] - elif project_key == "LRAC": - components = ["Test Infrastructure"] - return components[0] diff --git a/liferay/jira/jira_components_sync.py b/liferay/jira/jira_components_sync.py index ce6a35f..4b30928 100644 --- a/liferay/jira/jira_components_sync.py +++ b/liferay/jira/jira_components_sync.py @@ -57,12 +57,8 @@ def main(): "w", ) - sync_project_components(jira_connection, "COMMERCE") - - sync_project_components(jira_connection, "LPS") + sync_project_components(jira_connection, "LPD") sync_project_components(jira_connection, "LRQA") - sync_project_components(jira_connection, "LRAC") - print(f"\033[1;32mSuccessful\033[0m") diff --git a/script_app.py b/script_app.py index 6d4af23..6e5d3ee 100644 --- a/script_app.py +++ b/script_app.py @@ -85,15 +85,13 @@ def compose(self) -> ComposeResult: yield Submit("button-2") with Form("nav-3"): PROJECT_KEY = [ - ("LPS", "LPS"), + ("LPD", "LPD"), ("LRQA", "LRQA"), - ("LRAC", "LRAC"), - ("COMMERCE", "COMMERCE"), ] yield TextField("Enter the case result id: ", "case-result-id") yield Label("Select the project key: ") - yield Select(PROJECT_KEY, id="project-key-1", value="LPS") + yield Select(PROJECT_KEY, id="project-key-1", value="LPD") yield ToggleSwitch("assign-to-me-1") yield TextField("Add label (Optional)", "add-label") yield Submit("button-3") @@ -158,10 +156,8 @@ def compose(self) -> ComposeResult: yield Submit("button-6") with Form("nav-7"): PROJECT_KEY = [ - ("LPS", "LPS"), + ("LPD", "LPD"), ("LRQA", "LRQA"), - ("LRAC", "LRAC"), - ("COMMERCE", "COMMERCE"), ] PRODUCT_TEAM = [ @@ -171,6 +167,7 @@ def compose(self) -> ComposeResult: ISSUE_TYPE = [ ("Bug", "Bug"), ("Task", "Task"), + ("Testing", "Testing"), ] BUG_TYPE = [ @@ -284,7 +281,7 @@ def create_test_fix_ticket(self) -> None: self.query_one("#assign-to-me-1").value = False self.query_one("#case-result-id").value = "" self.query_one("#add-label").value = "" - self.query_one("#project-key-1").value = "LPS" + self.query_one("#project-key-1").value = "LPD" except (AssertionError, JIRAError, json.decoder.JSONDecodeError): print( f"\033[1;31mPlease check your credentials in credentials-ext.properties\033[0m"