# Concedi badge tramite Automation

**URL:** https://meta.discourse.org/t/grant-badges-through-automation/232715
**Category:** Feature
**Tags:** badges, automation
**Created:** [3 Maggio 2022, 6:07pm UTC](https://meta.discourse.org/t/grant-badges-through-automation/232715 "2022-05-03T18:07:51Z")
**Posts on this page:** 1
**Showing post:** 3

<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: [5 Maggio 2022, 3:07pm UTC](https://meta.discourse.org/t/grant-badges-through-automation/232715/3 "2022-05-05T15:07:47Z")

</div>

Ho terminato la pull request e questa è attualmente in attesa di revisione:

> <https://github.com/discourse/discourse-automation/pull/109>
>
> This trigger needs a \`badge\` as required field and accepts an optional \`only\_on\_…first\_grant\` field. ATM it’s usable for: \`send\_pms\` and \`zapier\_webhook\` scripts.

Nota che questo richiederà un’istanza di discourse aggiornata per funzionare correttamente poiché ho scoperto un bug relativo al badge granter mentre ci lavoravo:

> <https://github.com/discourse/discourse/commit/81580e559c3806df6143c86610f51253809372c7>
>
> This bug was causing double events to be fired as :user\_badge\_granted is already… called when a \`user\_badge\` is created. More over the signature of the block in the UserBadge code is \`badge\_id, user\_id\` not \`badge, user\_id\`.

---

_[View the full topic](https://meta.discourse.org/t/grant-badges-through-automation/232715)._
