Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/config.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
status_map: *basic-status-map
resolution_map: *basic-resolution-map
priority_map:
"": (none)
"--": (None)
P1: P1
P2: P2
P3: P3
Expand Down
4 changes: 3 additions & 1 deletion jbi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class ActionParams(BaseModel, frozen=True):
labels_brackets: Literal["yes", "no", "both"] = "no"
status_map: dict[str, str] = {}
priority_map: dict[str, str] = {
"": "(none)",
"": "(None)",
"--": "(None)",
"P1": "P1",
"P2": "P2",
"P3": "P3",
Expand All @@ -107,6 +108,7 @@ class ActionParams(BaseModel, frozen=True):
resolution_map: dict[str, str] = {}
severity_map: dict[str, str] = {
"": "N/A",
"--": "N/A",
"S1": "S1",
"S2": "S2",
"S3": "S3",
Expand Down
5 changes: 5 additions & 0 deletions jbi/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ def _maybe_update_issue_mapped_field(
)
return (StepStatus.INCOMPLETE, context)

# Special handling for clearing fields in Jira.
if target_value == "(None)":
target_value = None
wrap_value = None

resp = jira_service.update_issue_field(
context,
target_field,
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,10 @@ def test_update_issue_remove_priority(
action_context = action_context_factory(
operation=Operation.UPDATE,
jira__issue="JBI-234",
bug__priority=None,
bug__priority="--",
current_step="maybe_update_issue_priority",
event__changes=[
webhook_event_change_factory(field="priority", removed="P1", added="--")
webhook_event_change_factory(field="priority", removed="P1", added="")
],
)
params = action_params_factory(
Expand All @@ -841,7 +841,7 @@ def test_update_issue_remove_priority(

assert result == steps.StepStatus.SUCCESS
mocked_jira.update_issue_field.assert_called_with(
key="JBI-234", fields={"priority": {"name": "(none)"}}
key="JBI-234", fields={"priority": None}
)


Expand Down
Loading