When this option is checked, is there a certain time that it’s scheduled to re-run?
If stuff is not triggered it runs daily, you can see when if you look at
sitename/sidekiq in the scheduler tab at the badge grant job.
You can also manually start the badge grant from there, as well, @etrowbridge.
Can you generalize it for all members of all groups?
That is a weird question, users in all groups == all users … there is a tl0 group you know…
I receive this error:
Switch it to “run daily”
Are there plans to add this trigger in the near future or should the techniques described in triggered custom badge queries be used to grant group membership immediately?
Could the trigger
when a user is edited or created be used to grant a badge for group membership immediately? Does adding a user to a group count as an edit?
How could the code provided above be adjusted to immediately grant group membership badges?
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' )
EDIT: Pardon my SQL but would this work?
select u.id user_id, current_timestamp granted_at from users u where u.id IN ( select user_id from group_users where group_id = ( select g.id from groups g where g.name = 'oktest' ) ) and (:backfill OR u.id IN (:user_ids) )
I find having to wait for the badge grant scheduler to run a bit of a pain especially if it’s a daily grant and creating a new badge. As we also don’t have access to sidekiq on the hosting the ability to run the process manually isn’t available. It would be useful if the job ran as you saved a new or edited a badge query.
I’ve been using this version for a while now, runs fine (slight modification of original query):
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' ) AND (:backfill OR user_id IN (:user_ids))
When a user is edited or created trigger (options: revoke daily, allow to be used as a title, show badge on public badges page). It gives the badge immediately upon group membership which is basically what I’m looking for, although it still only revokes the badge with the daily job.
Thank you @Yuun - that works perfectly and as you describe. Is there a way to find out when the daily badge revocation job runs on a hosted discourse instance?
Are you able to go to
yourdomain.com/sidekiq/scheduler on your instance? I think the revocation query is part of the regular Badge Grant job, just look for when it’s next scheduled to occur.
No, not on his hosted instance.
I checked hourly and noticed a change at 11:40pm Brisbane Australia = 2pm London = 9am Washington.
Revocation worked fine Thanks for your help
Working on creating manual, trigger-driven badges for our hosted instance. I have a few questions if someone could help answer them so that we fully understand.
Before I ask my questions, I have just a general suggestion for badge creations. Would it be possible to implement just a “tool-tip” for each field explaining just a bit about what it is…what it does, etc.,?
So, now for my specific question is…
- What is the purpose of the “Group” field, when creating a new field? I’ve read @sam’s post regarding assigning a badge for everyone that’s part of a group, but what if we don’t really have, or want, any “group” assigned to users who are awarded badges? For instance, for our discourse instance, we have a custom user field created which each user completes as part of their initial profile setup. The selection they make in this field determines what specific “badge” they get (automatically). For instance, if they select that they are a “Type 1 Diabetic”, they would get a “badge” automatically for Type 1. The true purpose of the badge is so that they can use the “title” that comes along with it…which they can make visible in our forums. So, in our instance, what group would even be relevant?? I am thinking “Getting Started”, but I just don’t know which one (if any) my badges would fit into and why it’s significant? Also, what are the implications of assigning groups? Will the groups appear on the Group listing? If so, would that mean that all members of a group could be messaged?
And IF we have to have a group applied…given my scenario that I listed…which would you suggest we use as the “group” assigned to these badges?
Sure, I support this if anyone wants to send through a PR
For context you are talking about this:
The group denotes the “group” this badge appears on in the badges page:
You use it to “group” together certain badges on the badge page. I agree the word group is not a great word here and we should probably rename it to “section”
This is AWESOME and it answers my question!
Thanks so much!
You guys are super helpful. We really appreciate all that you’ve helped us with as we have set up our instance.
A post was merged into an existing topic: Required custom fields for signup are not required for invites