Bug Report: "Auto Tag Topic" in Discourse Automation — Link Detection Not Working, Onebox Triggers Image

I’ve been testing the “Auto Tag Topic” feature in the Discourse Automation plugin, and I’ve encountered some unexpected behavior with the link and image conditions.

:white_check_mark: What works and what doesn’t

Image condition:

  • Uploading an image (via drag-and-drop or file upload) correctly triggers the automation.
  • If a topic includes a Onebox (e.g. from Twitter, YouTube, or GitHub), it can also trigger the image condition, likely due to the embedded preview image.
  • :white_check_mark: Fortunately, regular image links (e.g. Markdown or bare .jpg URLs) are not falsely recognized as uploads — this is a helpful distinction and avoids incorrect tagging.

Link condition:

  • The link condition does not trigger at all, regardless of how the link is added:
    • [Example](https://example.com) (Markdown)
    • https://example.com (bare URL)
    • Links that generate Oneboxes
    • Links that do not generate Oneboxes

This makes the link option currently unreliable or possibly broken.


:pushpin: Summary

Condition Works? Notes
Upload :white_check_mark: Yes Triggers reliably
Image :warning: Partially Uploads work; Oneboxes also trigger this
Code :white_check_mark: Yes Works as expected
Link :cross_mark: No Does not trigger under any tested scenario

If the current link behavior is unintentional, I hope it can be addressed in a future update.
Thanks for all the work on this plugin — it’s a powerful tool that could be even better with a few refinements.

Hi,

It’s surprising to me because we have an explicit test for this:

it "fires the trigger when post has a link" do
  list =
    capture_contexts do
      PostCreator.create(
        user,
        raw: "Check out this [link](https://example.com)",
        topic_id: topic.id,
      )
    end

  expect(list.length).to eq(1)
  expect(list[0]["kind"]).to eq("post_created_edited")
end

Can you give me a screenshot of the whole automation you are trying, and the raw of the post which didn’t trigger please?

:green_circle: Update (Resolved)
The link condition works correctly — my issue was due to tag restrictions limited to certain categories.

Additionally, I found that both Oneboxes and image links trigger both the link and image conditions.
I’d like to request a way to distinguish uploaded images from image links, so that image tags only trigger for uploads.

This distinction matters because some plugins (such as Topic List Previews) only generate preview thumbnails for uploaded images — not for external image links.

1 Like