# Automatically Apply Badges to Group Members (in Hosted Version)

**URL:** <https://meta.discourse.org/t/automatically-apply-badges-to-group-members-in-hosted-version/63728>\
**Category:** Support\
**Created:** [2017年六月1日 11:58 UTC](https://meta.discourse.org/t/automatically-apply-badges-to-group-members-in-hosted-version/63728 "2017-06-01T11:58:29Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![scombs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scombs/32/48616_2.png) [@scombs](https://meta.discourse.org/u/scombs)\
**Post date:** [2017年十月4日 00:00 UTC](https://meta.discourse.org/t/automatically-apply-badges-to-group-members-in-hosted-version/63728/10 "2017-10-04T00:00:47Z")

</div>

Not sure. I saw the [other post](https://meta.discourse.org/t/badge-sql-can-no-longer-be-edited-by-default/47894/30) too.

Here is the #howto with the code

> [@Grant a badge for all members of a group](https://meta.discourse.org/t/automatically-grant-a-badge-for-all-members-of-a-group/18147):
>
> I just created a badge for all the awesome [plugin authors](https://meta.discourse.org/badges). Creating a badge targeting a group is quite easy, just type this into the SQL box: select user\_id, created\_at granted\_at, NULL post\_id from group\_users where group\_id = ( select g.id from groups g where g.name = 'GROUP\_NAME\_IN\_LOWER\_HERE' ) I will add a trigger for this at some point so granting is faster, in the mean time just go to /sidekiq/scheduler and kick off the badge job to rush it. See [Triggered custom badge queries](https://meta.discourse.org/t/triggered-custom-badge-queries/19336) for mo…

---

_[View the full topic](https://meta.discourse.org/t/automatically-apply-badges-to-group-members-in-hosted-version/63728)._
