# What is the bug reporter badge?

**URL:** <https://meta.discourse.org/t/what-is-the-bug-reporter-badge/17987>\
**Category:** Data & reporting\
**Tags:** sql-triggered-badge\
**Created:** [Julho 24, 2014, 8:58am UTC](https://meta.discourse.org/t/what-is-the-bug-reporter-badge/17987 "2014-07-24T08:58:01Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [Julho 24, 2014, 8:58am UTC](https://meta.discourse.org/t/what-is-the-bug-reporter-badge/17987/1 "2014-07-24T08:58:01Z")

</div>

You may or may have not noticed this new badge:

[https://meta.discourse.org/badges/114/bug-reporter](https://meta.discourse.org/badges/114/bug-reporter)

What I find super exciting about it is that there are **zero** plugins needed, I crafted it using our badges UI. Not only does it grant the badge daily, it will also grant it after one of the team “likes” a bug.

It runs the following badge query:

```plaintext
SELECT p.user_id, min(p.created_at) granted_at, MIN(p.id) post_id
FROM badge_posts p
JOIN topics t ON t.id = p.topic_id
JOIN post_actions pa ON pa.post_id = p.id AND 
      post_action_type_id = (
                SELECT id FROM post_action_types WHERE name_key = 'like'
       ) AND 
       pa.user_id IN (
           SELECT gu.user_id
           FROM group_users gu
           WHERE gu.group_id = ( SELECT id FROM groups WHERE name ilike 'discourse' ) 
       )
WHERE category_id = (
  SELECT id FROM categories WHERE name ilike 'bug'
) AND p.post_number = 1
GROUP BY p.user_id

```

The UI is still a tiny bit rough, but I find it super duper cool that the badge system is this extensible. Will knock up a silver version of this badge tomorrow and call it tester 🐛

Thank you all for reporting bugs so diligently.

---

_[View the full topic](https://meta.discourse.org/t/what-is-the-bug-reporter-badge/17987)._
