From f559fc95575ee569a5d15b956328452e14345a59 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 12 Jul 2021 18:34:13 +0200 Subject: [PATCH] FIX: automation fields now all use the same value property (#170) --- plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.rb b/plugin.rb index 8282e6b..fb82444 100644 --- a/plugin.rb +++ b/plugin.rb @@ -567,11 +567,11 @@ after_initialize do script do |context, fields| next unless SiteSetting.assign_enabled? - next unless group_id = fields.dig('assignees_group', 'group_id') + next unless group_id = fields.dig('assignees_group', 'value') next unless group = Group.find_by(id: group_id) assign_to = group.group_users.order(Arel.sql('RANDOM()')).first.user - next unless topic_id = fields.dig('assigned_topic', 'text') + next unless topic_id = fields.dig('assigned_topic', 'value') next unless topic = Topic.find_by(id: topic_id) TopicAssigner.new(topic, Discourse.system_user).assign(assign_to)