@@ -285,9 +285,11 @@ def check_for_and_create_comment(parsed_json):
285285 finding .notes .add (new_note )
286286 finding .jira_issue .jira_change = timezone .now ()
287287 finding .jira_issue .save ()
288- # Only update the timestamp, not other fields like 'active' to avoid
288+ finding .last_reviewed = new_note .date
289+ finding .last_reviewed_by = author
290+ # Only update the timestamp fields, not other fields like 'active' to avoid
289291 # race conditions with concurrent webhook events (e.g. issue_updated)
290- finding .save (update_fields = ["updated" ])
292+ finding .save (update_fields = ["last_reviewed" , "last_reviewed_by" , " updated" ])
291293 return None
292294
293295
@@ -345,11 +347,11 @@ def post(self, request):
345347 # Get the open and close keys
346348 msg = "Unable to find Open/Close ID's (invalid issue key specified?). They will need to be found manually"
347349 try :
350+ open_key = close_key = None
348351 issue_id = jform .cleaned_data .get ("issue_key" )
349352 key_url = jira_server .strip ("/" ) + "/rest/api/latest/issue/" + issue_id + "/transitions?expand=transitions.fields"
350353 response = jira ._session .get (key_url ).json ()
351354 logger .debug ("Retrieved JIRA issue successfully" )
352- open_key = close_key = None
353355 for node in response ["transitions" ]:
354356 if node ["to" ]["statusCategory" ]["name" ] == "To Do" :
355357 open_key = open_key or int (node ["id" ])
0 commit comments