Skip to content

Commit a9a640a

Browse files
committed
Ref #1055: use update field in payload for comments
1 parent 2c3f5de commit a9a640a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

jbi/jira/service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,11 @@ def update_issue_status(self, context: ActionContext, jira_status: str):
293293
kwargs = {}
294294
if jira_status == "Cancelled":
295295
kwargs["fields"] = {
296-
"comment": "Issue was cancelled.",
297296
"resolution": {"name": "Invalid"},
298297
}
298+
kwargs["update"] = {
299+
"comment": [{"add": {"body": "Issue was cancelled."}}],
300+
}
299301

300302
logger.info(
301303
"Updating Jira status to %s",

tests/unit/jira/test_service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,11 @@ def test_update_issue_status_adds_comment_and_resolution_when_cancelled(
193193
{
194194
"transition": {"id": 42},
195195
"fields": {
196-
"comment": "Issue was cancelled.",
197196
"resolution": {"name": "Invalid"},
198197
},
198+
"update": {
199+
"comment": [{"add": {"body": "Issue was cancelled."}}],
200+
},
199201
}
200202
)
201203
],

0 commit comments

Comments
 (0)