Need to add tag when any of 4 other tags exist on topic

DiscourseEvent.on(:topic_created) do |topic|
  guardian = Guardian.new(Discourse.system_user)
  required_tag_names = [”sync1”, “sync2”, “sync3”, “sync4”]
  DiscourseTagging.tag_topic_by_names(topic, guardian, ["apim"], append: true) if topic.tags.exists?(name: required_tag_names)
end

You need this :arrow_up: code.

Edit: You can also enforce it by adding a tag group and setting “apim” as the parent tag. In that case, users can choose “sync” tags only after selecting the parent tag “apim”.


I think it will be more useful if we allow users to select child tags first then we add the parent tag automatically :person_shrugging: Most end users won’t know about the parent tag requirements.