We've asked users to change their notification settings to Immediate but not everyone does.
I'd like to run a database query or a make REST API calls to do this in bulk for everyone.
It doesn't appear that there is a REST API for this. What table is the data stored in? I couldn't track it down eyeballing the Bitbucket table names and looking deeper at some of them.
Hello Eric,
When you update the notification settings of a user, it is stored in a table called sta_shared_lob. Now this is not like the usual tables, the values for email and general notifications are not stored individually, instead they are combined into one large string and stored. For example:
lob_data
{"plugin.bitbucket-notification:email:repositoryNotificationSendMode":"BATCHED","plugin.bitbucket-notification:notificationSendMode":"BATCHED","user.created.version":"5.16.0"} |
The best way to go about this would be to replace, the word BATCHED with IMMEDIATE in this table for all users.
PLEASE NOTE: Directly manipulating the database of the production environment is not advised. Please take a backup of the DB and first perform the steps on a test bitbucket server to see if this works and nothing breaks.
Run the following SQL query to replace all the occurrences of the word "BATCHED" to "IMMEDIATE":
UPDATE sta_shared_lob
SET lob_data = replace(lob_data, 'BATCHED', 'IMMEDIATE')
This query was written for a PostgreSQL DB, so please make changes appropriately for your DB type.
Regards,
Sujay Raj
Thanks Sujay -
Are there any caches that I’ll need to clear after doing this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like some rows don't have any
"plugin.bitbucket-notification:email:repositoryNotificationSendMode":"BATCHED"
So for these I'll need to add the full
"plugin.bitbucket-notification:email:repositoryNotificationSendMode":"IMMEDIATE"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.