# Includi „Motivazione“ nell'azione di Discourse Assegna badge nei flussi di lavoro

**URL:** <https://meta.discourse.org/t/include-reason-in-grant-badge-discourse-action-in-workflows/417202>\
**Category:** Feature\
**Tags:** badges, workflows\
**Created:** [12 Novembre 2026, 12:43pm UTC](https://meta.discourse.org/t/include-reason-in-grant-badge-discourse-action-in-workflows/417202 "2026-11-12T12:43:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)\
**Post date:** [19 Novembre 2026, 9:04pm UTC](https://meta.discourse.org/t/include-reason-in-grant-badge-discourse-action-in-workflows/417202/3 "2026-11-19T21:04:21Z")

</div>

Mi sembra ragionevole! Ho aggiunto la funzionalità qui:

> <https://github.com/discourse/discourse/pull/46541>
>
> Requested here: https://meta.discourse.org/t/include-reason-in-grant-badge-disco…urse-action-in-workflows/417202
> 
> Previously, badges granted by a workflow could not be linked to a post or topic, unlike grants made from the admin UI.
> 
> \<img width="630" height="216" alt="image" src="https://github.com/user-attachments/assets/77c0b5e4-998f-4eb6-ae8e-984152eaf317" /\>
> 
> 
> This change adds an optional \`reason\` field to the badge node. It accepts a post or topic URL, or a prefixed \`post:123\` / \`topic:123\` ID, and is hidden for system badges whose posts are never shown. 
> 
> To support this, the reason-URL parsing moves from \`UserBadgesController\` into \`BadgeGranter.post\_for\_reason\`, so the admin grant form now also links \`/p/…\` and \`/posts/…\` URLs to their post. A new \`metadata\_flag\` display condition hides fields based on flags in a node's option data, in both the editor and the server.

---

_[View the full topic](https://meta.discourse.org/t/include-reason-in-grant-badge-discourse-action-in-workflows/417202)._
