# להעניק תג כאשר משתמש מבקר בקישור

**URL:** https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700
**Category:** Data & reporting
**Tags:** sql-triggered-badge
**Created:** [25 באוגוסט,‏ 2023,‏ 10:55pm UTC](https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700 "2023-08-25T22:55:08Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [30 באוגוסט,‏ 2023,‏ 2:46pm UTC](https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700/22 "2023-08-30T14:46:09Z")

</div>

Still nothing, I tried visiting based on the URL directly, clicking on it from search, and clicking from the ‘Latest’ topics page.

Triggered this, and still nothing.

> [@JammyDodger](#):
>
> manually trigger `Jobs::BadgeGrant`

---

<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: [30 באוגוסט,‏ 2023,‏ 2:48pm UTC](https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700/23 "2023-08-30T14:48:57Z")

</div>

And you’re using the topic\_id and not the post\_id for this one?

https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700/17

---

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [30 באוגוסט,‏ 2023,‏ 2:55pm UTC](https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700/24 "2023-08-30T14:55:08Z")

</div>

There you go, this was the problem lol. Sorry about that. It’s working now.

---

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [30 באוגוסט,‏ 2023,‏ 2:55pm UTC](https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700/25 "2023-08-30T14:55:48Z")

</div>

Next question, can we upgrade a users trust level based on them being granted a badge?

And can we hide a topic entirely from public view and only make it visible via direct link?

---

<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: [30 באוגוסט,‏ 2023,‏ 3:15pm UTC](https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700/26 "2023-08-30T15:15:13Z")

</div>

> [@Sami\_Syed](#):
>
> can we upgrade a users trust level based on them being granted a badge?

There is a brand new ‘User Group Membership through Badge’ script for the automation plugin that may be suitable - though rather than adding them to a Trust Level group directly I think I would consider adding them to a custom group which granted a particular trust level (that way they shouldn’t be downgraded when the trust levels are periodically recalculated).

> [@Sami\_Syed](#):
>
> And can we hide a topic entirely from public view and only make it visible via direct link?

For this, I’m thinking Unlisting the topic is likely the best route. Unlisting does still send out notifications though for anyone Watching/Watching First Post a category, so you may also want to consider creating a brand new subcategory to put it in which nobody will have had a chance to start Watching yet.

---

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [30 באוגוסט,‏ 2023,‏ 3:24pm UTC](https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700/27 "2023-08-30T15:24:16Z")

</div>

> [@JammyDodger](#):
>
> adding them to a custom group

how do I add them to a custom group based on them being granted a badge, and then how do I grant them the trust level based on being in the group ?

> [@JammyDodger](#):
>
> ‘User Group Membership through Badge’ script for the automation plugin

where can I find this script

---

<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: [30 באוגוסט,‏ 2023,‏ 4:30pm UTC](https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700/28 "2023-08-30T16:30:08Z")

</div>

> [@Sami\_Syed](#):
>
> how do I add them to a custom group based on them being granted a badge, and then how do I grant them the trust level based on being in the group ?

You would use the Automation script (see below). As part of creating a group, you can assign a trust level to be automatically granted with it:

 ![set trust level for group](https://global.discourse-cdn.com/meta/original/4X/c/d/1/cd1a96b639ba77a2790cb8d11f7706e4a0c59c70.png)

> [@Sami\_Syed](#):
>
> where can I find this script

It’s part of the Automation plugin:

> [@Discourse Automation](https://meta.discourse.org/t/discourse-automation/195773):
>
> discourse2Summary Discourse Automation lets you automate actions through scripts and triggers. Customisation is made through an automatically generated UI.open_bookInstall Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately. Features Easy automation of complex workflows Triggers automations at specific dates, periodically, or on specific events Provides automatically generated UIs…

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [29 בספטמבר,‏ 2023,‏ 4:30pm UTC](https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700/29 "2023-09-29T16:30:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

[Previous page](https://meta.discourse.org/t/grant-badge-when-user-visits-link/276700.md?page=1)
