Open awakenine opened 2 years ago
I can tkae this one.
@damiencarol it would be nice to add trying to get 'displayName' value, if 'name' does not exists.
Hi. Problem still persist for me in 2.15.* version (both Docker Compose / Kubernetes) There is case when there is no assignee in Jira for current task and webhook notification ends with 500 error from DefectDojo side. django-DefectDojo/dojo/jira_link/views.py
Error example:
[22/Nov/2022 13:20:54] ERROR [django.request:224] Internal Server Error: /jira/webhook/ Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "/usr/local/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, *kwargs) File "/usr/local/lib/python3.8/site-packages/django/views/decorators/http.py", line 40, in inner return func(request, args, kwargs) File "/app/./dojo/jira_link/views.py", line 106, in webhook jira_helper.process_resolution_from_jira(finding, resolution_id, resolution_name, assignee_name, jira_now, jissue) UnboundLocalError: local variable 'assignee_name' referenced before assignment
@damiencarol Should we reopen issue?
Bug description Issue status can't be changed with Jira webhook, because of error at line https://github.com/DefectDojo/django-DefectDojo/blob/9d196df3f263df6796ba3c2deb42d78efb43cf37/dojo/jira_link/views.py#L80
It throws error if assignee is present, but doesn't have name key (in my case it has 'displayName' key instead). I'm thinking about fast fix changing the check of field existence to fix to the code below, but I also would like to add check for 'displayName' existence in case name is absent. If you have good idea on how to solve that I would appreciate.
Fast fix:
Expected behavior Status successfully changes
Deployment method (select with an
X
)Logs Use
docker-compose logs
(or similar, depending on your deployment method) to get the logs and add the relevant sections here showing the error occurring (if applicable).