@@ -728,6 +728,54 @@ def test_change_to_unknown_resolution_with_resolution_map(
728728 ]
729729
730730
731+ def test_create_issue_empty_priority (
732+ action_context_factory ,
733+ mocked_jira ,
734+ action_params_factory ,
735+ ):
736+ action_context = action_context_factory (
737+ operation = Operation .CREATE , bug__priority = None
738+ )
739+ params = action_params_factory (
740+ jira_project_key = action_context .jira .project ,
741+ )
742+
743+ result , _ = steps .maybe_update_issue_priority (
744+ action_context , parameters = params , jira_service = JiraService (mocked_jira )
745+ )
746+
747+ assert result == steps .StepStatus .NOOP
748+
749+
750+ def test_update_issue_remove_priority (
751+ action_context_factory ,
752+ mocked_jira ,
753+ action_params_factory ,
754+ webhook_event_change_factory ,
755+ ):
756+ action_context = action_context_factory (
757+ operation = Operation .UPDATE ,
758+ jira__issue = "JBI-234" ,
759+ bug__priority = None ,
760+ current_step = "maybe_update_issue_priority" ,
761+ event__changes = [
762+ webhook_event_change_factory (field = "priority" , removed = "P1" , added = "--" )
763+ ],
764+ )
765+ params = action_params_factory (
766+ jira_project_key = action_context .jira .project ,
767+ )
768+
769+ result , _ = steps .maybe_update_issue_priority (
770+ action_context , parameters = params , jira_service = JiraService (mocked_jira )
771+ )
772+
773+ assert result == steps .StepStatus .SUCCESS
774+ mocked_jira .update_issue_field .assert_called_with (
775+ key = "JBI-234" , fields = {"priority" : {"name" : "(none)" }}
776+ )
777+
778+
731779def test_update_issue_priority (
732780 action_context_factory ,
733781 mocked_jira ,
0 commit comments