diff --git a/openpype/modules/slack/plugins/publish/collect_slack_family.py b/openpype/modules/slack/plugins/publish/collect_slack_family.py index 2110c0703b..6c965b04cd 100644 --- a/openpype/modules/slack/plugins/publish/collect_slack_family.py +++ b/openpype/modules/slack/plugins/publish/collect_slack_family.py @@ -20,18 +20,23 @@ class CollectSlackFamilies(pyblish.api.InstancePlugin): def process(self, instance): task_name = io.Session.get("AVALON_TASK") family = self.main_family_from_instance(instance) - key_values = { "families": family, "tasks": task_name, "hosts": instance.data["anatomyData"]["app"], + "subsets": instance.data["subset"] } profile = filter_profiles(self.profiles, key_values, logger=self.log) + if not profile: + self.log.info("No profile found, notification won't be send") + return + # make slack publishable if profile: + self.log.info("Found profile: {}".format(profile)) if instance.data.get('families'): instance.data['families'].append('slack') else: diff --git a/openpype/settings/defaults/project_settings/slack.json b/openpype/settings/defaults/project_settings/slack.json index 2d10bd173d..d77b8c2208 100644 --- a/openpype/settings/defaults/project_settings/slack.json +++ b/openpype/settings/defaults/project_settings/slack.json @@ -10,6 +10,7 @@ "hosts": [], "task_types": [], "tasks": [], + "subsets": [], "channel_messages": [] } ] diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_slack.json b/openpype/settings/entities/schemas/projects_schema/schema_project_slack.json index 4e82c991e7..14814d8b01 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_slack.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_slack.json @@ -69,6 +69,12 @@ "type": "list", "object_type": "text" }, + { + "key": "subsets", + "label": "Subset names", + "type": "list", + "object_type": "text" + }, { "type": "separator" }, diff --git a/website/docs/module_slack.md b/website/docs/module_slack.md index 67b200259d..3a2842da63 100644 --- a/website/docs/module_slack.md +++ b/website/docs/module_slack.md @@ -47,7 +47,7 @@ It is possible to create multiple tokens and configure different scopes for them ### Profiles Profiles are used to select when to trigger notification. One or multiple profiles -could be configured, `Families`, `Task names` (regex available), `Host names` combination is needed. +could be configured, `Families`, `Task names` (regex available), `Host names`, `Subset names` (regex available) combination is needed. Eg. If I want to be notified when render is published from Maya, setting is: