Repository navigation
jira webhook: fix incoming author name check - #3606
Merged
valentijnscholten merged 8 commits intoJan 17, 2021
Merged
valentijnscholten merged 8 commits into
valentijnscholten merged 8 commits into
Conversation
madchap
reviewed
Jan 10, 2021
madchap
reviewed
Jan 10, 2021
damiencarol
suggested changes
Jan 17, 2021
damiencarol
left a comment
Contributor
There was a problem hiding this comment.
I think big object dumps of JIRA hook should be removed from code
damiencarol
approved these changes
Jan 17, 2021
Closed
9alexx3
pushed a commit
to 9alexx3/django-DefectDojo
that referenced
this pull request
Aug 12, 2026
* jira: fix author check on incoming comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On an incoming comment from JIRA, the webhook checks for the author of the comment. If it matches a username used in one of the JIRA instances, it assumes that the incoming comment is actually a comment that was entered as note in defect dojo and pushed to jira. Which triggers a webhook back to defect dojo. The webhook needs to be ignored, because the comment is already in defect dojo.
This intention is correct.
However, the check was done on JIRA
displayNameinstead of the JIRAkeyfield. So the check only succeeded if the displayname in JIRA was the same as the username used in defect dojo. In my setup it was:username: defect.dojo
displayname: Defect Dojo
So it never matches. The check was also doing a
if jira_username_in_dojo in comment_author_from_jirawhich is not always correct.This PR changes the matching logic to use the JIRA username field instead of the displayname, and uses an exact match. And adds a unit test.