diff --git a/jbi/jira/service.py b/jbi/jira/service.py index c83636bc..40163408 100644 --- a/jbi/jira/service.py +++ b/jbi/jira/service.py @@ -290,12 +290,14 @@ def update_issue_status(self, context: ActionContext, jira_status: str): issue_key = context.jira.issue assert issue_key # Until we have more fine-grained typing of contexts - kwargs = {} + kwargs: dict[str, Any] = {} if jira_status == "Cancelled": kwargs["fields"] = { - "comment": "Issue was cancelled.", "resolution": {"name": "Invalid"}, } + kwargs["update"] = { + "comment": [{"add": {"body": "Issue was cancelled."}}], + } logger.info( "Updating Jira status to %s", diff --git a/tests/unit/jira/test_service.py b/tests/unit/jira/test_service.py index 8aa17395..5800de0b 100644 --- a/tests/unit/jira/test_service.py +++ b/tests/unit/jira/test_service.py @@ -193,9 +193,11 @@ def test_update_issue_status_adds_comment_and_resolution_when_cancelled( { "transition": {"id": 42}, "fields": { - "comment": "Issue was cancelled.", "resolution": {"name": "Invalid"}, }, + "update": { + "comment": [{"add": {"body": "Issue was cancelled."}}], + }, } ) ],