Skip to content

Commit b999308

Browse files
authored
Fix #750: set resolution using "name" field (#883)
Fix #750: set resolution using 'name' field
1 parent c6cb0b7 commit b999308

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

jbi/jira/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def update_issue_resolution(self, context: ActionContext, jira_resolution: str):
298298
)
299299
response = self.client.update_issue_field(
300300
key=issue_key,
301-
fields={"resolution": jira_resolution},
301+
fields={"resolution": {"name": jira_resolution}},
302302
)
303303
logger.debug(
304304
"Updated resolution of Jira issue %s to %s",

tests/unit/jira/test_service.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ def test_update_issue_resolution(
193193
responses.PUT,
194194
url,
195195
match=[
196-
responses.matchers.json_params_matcher({"fields": {"resolution": "DONEZO"}})
196+
responses.matchers.json_params_matcher(
197+
{"fields": {"resolution": {"name": "DONEZO"}}}
198+
)
197199
],
198200
)
199201

@@ -215,7 +217,9 @@ def test_update_issue_resolution_raises(
215217
url,
216218
status=401,
217219
match=[
218-
responses.matchers.json_params_matcher({"fields": {"resolution": "DONEZO"}})
220+
responses.matchers.json_params_matcher(
221+
{"fields": {"resolution": {"name": "DONEZO"}}}
222+
)
219223
],
220224
)
221225

tests/unit/test_steps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ def test_change_to_known_resolution_with_resolution_map(
682682
mocked_jira.update_issue_field.assert_called_with( # not once
683683
key="JBI-234",
684684
fields={
685-
"resolution": "Duplicate",
685+
"resolution": {"name": "Duplicate"},
686686
},
687687
)
688688

0 commit comments

Comments
 (0)