Skip to content

Commit a02c4e3

Browse files
JIRA instance config: improve error handling on open/close status ids (#13326)
1 parent 5e7fe2a commit a02c4e3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

dojo/jira_link/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ def post(self, request):
327327
return render(request, self.get_template(), {"jform": jform})
328328
# authentication successful
329329
# Get the open and close keys
330+
msg = "Unable to find Open/Close ID's (invalid issue key specified?). They will need to be found manually"
330331
try:
331332
issue_id = jform.cleaned_data.get("issue_key")
332333
key_url = jira_server.strip("/") + "/rest/api/latest/issue/" + issue_id + "/transitions?expand=transitions.fields"
@@ -339,8 +340,9 @@ def post(self, request):
339340
if node["to"]["statusCategory"]["name"] == "Done":
340341
close_key = close_key or int(node["id"])
341342
except Exception:
342-
msg = "Unable to find Open/Close ID's (invalid issue key specified?). They will need to be found manually"
343343
logger.exception(msg) # already logged in jira_helper
344+
345+
if not open_key or not close_key:
344346
messages.add_message(
345347
request,
346348
messages.ERROR,

0 commit comments

Comments
 (0)