@@ -714,3 +714,54 @@ def test_request_triggers_multiple_actions(
714
714
assert len (actions ) == len (details )
715
715
assert "devtest" in details
716
716
assert "other" in details
717
+
718
+
719
+ def test_request_triggers_multiple_update_actions (
720
+ webhook_request_factory ,
721
+ mocked_bugzilla ,
722
+ mocked_jira ,
723
+ ):
724
+ actions = factories .ActionsFactory (
725
+ root = [
726
+ factories .ActionFactory (
727
+ whiteboard_tag = "devtest" ,
728
+ bugzilla_user_id = "tbd" ,
729
+ description = "test config" ,
730
+ parameters__jira_project_key = "JBI" ,
731
+ ),
732
+ factories .ActionFactory (
733
+ whiteboard_tag = "other" ,
734
+ bugzilla_user_id = "tbd" ,
735
+ description = "test config" ,
736
+ parameters__jira_project_key = "DE" ,
737
+ ),
738
+ ]
739
+ )
740
+
741
+ webhook = webhook_request_factory (
742
+ bug__whiteboard = "[devtest][other]" ,
743
+ bug__see_also = [
744
+ "https://mozilla.atlassian.net/browse/JBI-234" ,
745
+ "https://mozilla.atlassian.net/browse/DE-567" ,
746
+ ],
747
+ )
748
+ mocked_bugzilla .get_bug .return_value = webhook .bug
749
+
750
+ def side_effect_for_get_issue (issue_key ):
751
+ if issue_key .startswith ("JBI-" ):
752
+ return {"fields" : {"project" : {"key" : "JBI" }}}
753
+ elif issue_key .startswith ("DE-" ):
754
+ return {"fields" : {"project" : {"key" : "DE" }}}
755
+
756
+ return None
757
+
758
+ mocked_jira .get_issue .side_effect = side_effect_for_get_issue
759
+
760
+ details = execute_action (request = webhook , actions = actions )
761
+
762
+ # Details has the following shape:
763
+ # {'devtest': {'responses': [..]}, 'other': {'responses': [...]}}
764
+ assert len (actions ) == len (details )
765
+ assert "devtest" in details
766
+ assert "other" in details
767
+ print (details )
0 commit comments