# Meta는 버그 리포터 배지를 어떻게 처리하나요?

**URL:** https://meta.discourse.org/t/how-does-meta-handle-the-bug-reporter-badge/273650
**Category:** Data & reporting
**Tags:** sql-triggered-badge
**Created:** [8월 2, 2023, 12:55오후 UTC](https://meta.discourse.org/t/how-does-meta-handle-the-bug-reporter-badge/273650 "2023-08-02T12:55:46Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [8월 2, 2023, 1:02오후 UTC](https://meta.discourse.org/t/how-does-meta-handle-the-bug-reporter-badge/273650/2 "2023-08-02T13:02:10Z")

</div>

해당 항목에 대해 커스텀 배지를 하나 만들었습니다. 👍 (자세한 정보는 [Creating triggered custom badge queries](https://meta.discourse.org/t/create-triggered-custom-badge-queries/19336) 과 [Enable Badge SQL](https://meta.discourse.org/t/badge-sql-can-no-longer-be-edited-by-default/47894) 에서 확인하실 수 있습니다)

해당 배지의 코드는 다음과 같습니다:

```sql
SELECT distinct p.user_id, p.created_at granted_at, 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 'team' ) 
       )
WHERE category_id = (
  SELECT id FROM categories WHERE name ilike 'bug'
) AND p.post_number = 1

```

(참고로, 특정 그룹의 특정 리액션을 기준으로 작동하도록 하는 유사한 배지도 만들었습니다 🙂)

---

_[View the full topic](https://meta.discourse.org/t/how-does-meta-handle-the-bug-reporter-badge/273650)._
