# Bugrapport: "Auto Tag Topic" in Discourse Automation — Linkdetectie werkt niet, Onebox triggert afbeelding

**URL:** https://meta.discourse.org/t/bug-report-auto-tag-topic-in-discourse-automation-link-detection-not-working-onebox-triggers-image/366784
**Category:** Support
**Tags:** automation
**Created:** [20 mei 2025 om 01:14 UTC](https://meta.discourse.org/t/bug-report-auto-tag-topic-in-discourse-automation-link-detection-not-working-onebox-triggers-image/366784 "2025-05-20T01:14:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![copymonopoly](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@copymonopoly](https://meta.discourse.org/u/copymonopoly)
#### Post date: [20 mei 2025 om 01:14 UTC](https://meta.discourse.org/t/bug-report-auto-tag-topic-in-discourse-automation-link-detection-not-working-onebox-triggers-image/366784/1 "2025-05-20T01:14:42Z")

</div>

I’ve been testing the **“Auto Tag Topic”** feature in the [Discourse Automation plugin](https://meta.discourse.org/t/discourse-automation), and I’ve encountered some unexpected behavior with the `link` and `image` conditions.

### ✅ 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.
- ✅ 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.

* * *

### 📌 Summary

| Condition | Works? | Notes |
| --- | --- | --- |
| `Upload` | ✅ Yes | Triggers reliably |
| `Image` | ⚠ Partially | Uploads work; Oneboxes also trigger this |
| `Code` | ✅ Yes | Works as expected |
| `Link` | ❌ 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.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [20 mei 2025 om 10:52 UTC](https://meta.discourse.org/t/bug-report-auto-tag-topic-in-discourse-automation-link-detection-not-working-onebox-triggers-image/366784/2 "2025-05-20T10:52:00Z")

</div>

Hi,

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

```ruby
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?

---

<div class="post-metadata">

### Author: ![copymonopoly](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@copymonopoly](https://meta.discourse.org/u/copymonopoly)
#### Post date: [20 mei 2025 om 16:02 UTC](https://meta.discourse.org/t/bug-report-auto-tag-topic-in-discourse-automation-link-detection-not-working-onebox-triggers-image/366784/3 "2025-05-20T16:02:16Z")

</div>

🟢 **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.
