diff --git a/dojo/fixtures/dojo_testdata.json b/dojo/fixtures/dojo_testdata.json index ae550f8bf81..b35d570eaab 100644 --- a/dojo/fixtures/dojo_testdata.json +++ b/dojo/fixtures/dojo_testdata.json @@ -2158,8 +2158,8 @@ "fields": { "configuration_name": "Happy little JIRA 2", "url": "https://defectdojo.atlassian.net/", - "username": "YOUR USERNAME", - "password": "YOU API TOKEN", + "username": "[YOUR USERNAME]", + "password": "[YOUR API TOKEN]", "default_issue_type": "Task", "epic_name_id": 10011, "open_status_key": 11, @@ -2253,7 +2253,7 @@ "component": "", "enable_engagement_epic_mapping": true, "jira_instance": 2, - "project_key": "key1" + "project_key": "NTEST" } }, { diff --git a/dojo/jira_link/helper.py b/dojo/jira_link/helper.py index 0ffe8253a2f..8aff8972401 100644 --- a/dojo/jira_link/helper.py +++ b/dojo/jira_link/helper.py @@ -785,7 +785,7 @@ def failure_to_add_message(message: str, exception: Exception, object: Any) -> b JIRAError.log_to_tempfile = False jira = get_jira_connection(jira_instance) except Exception as e: - message = f"The following jira instance could not be connected: {jira_instance} - {e.text}" + message = f"The following jira instance could not be connected: {jira_instance} - {e}" return failure_to_add_message(message, e, obj) # Set the list of labels to set on the jira issue labels = get_labels(obj) + get_tags(obj) @@ -793,6 +793,7 @@ def failure_to_add_message(message: str, exception: Exception, object: Any) -> b labels = list(dict.fromkeys(labels)) # de-dup # Determine what due date to set on the jira issue duedate = None + if System_Settings.objects.get().enable_finding_sla: duedate = obj.sla_deadline() # Set the fields that will compose the jira issue @@ -1104,6 +1105,7 @@ def get_issuetype_fields( issuetype_fields = None use_cloud_api = jira.deploymentType.lower() == "cloud" or jira._version < (9, 0, 0) + try: if use_cloud_api: try: