diff --git a/dojo/api_v2/views.py b/dojo/api_v2/views.py index c1a3b12db6..3998683c31 100644 --- a/dojo/api_v2/views.py +++ b/dojo/api_v2/views.py @@ -1124,6 +1124,9 @@ def notes(self, request, pk=None): note_type=note_type, ) note.save() + finding.last_reviewed = note.date + finding.last_reviewed_by = author + finding.save(update_fields=["last_reviewed", "last_reviewed_by", "updated"]) finding.notes.add(note) # Determine if we need to send any notifications for user mentioned process_tag_notifications( diff --git a/dojo/jira_link/views.py b/dojo/jira_link/views.py index 31841c9bf4..807558b7aa 100644 --- a/dojo/jira_link/views.py +++ b/dojo/jira_link/views.py @@ -285,9 +285,11 @@ def check_for_and_create_comment(parsed_json): finding.notes.add(new_note) finding.jira_issue.jira_change = timezone.now() finding.jira_issue.save() - # Only update the timestamp, not other fields like 'active' to avoid + finding.last_reviewed = new_note.date + finding.last_reviewed_by = author + # Only update the timestamp fields, not other fields like 'active' to avoid # race conditions with concurrent webhook events (e.g. issue_updated) - finding.save(update_fields=["updated"]) + finding.save(update_fields=["last_reviewed", "last_reviewed_by", "updated"]) return None