The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner: Bulk Update Timezone Preferences for all Members of a Group

Guru Darbar Khalsa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 20, 2018

Using Scriptrunner, I'm trying to bulk update the Timezone preferences for members in a group.

This works for individual users but, I can't seem to figure out how to apply it to all the members in a group.

Any help would be greatly appreciated.

import com.atlassian.jira.component.ComponentAccessor
import
com.atlassian.jira.user.preferences.PreferenceKeys


def userManager = ComponentAccessor.getUserManager()
def preferencesManager = ComponentAccessor.getUserPreferencesManager()

userManager.getUserByName('username').each { user ->
preferencesManager.getExtendedPreferences(user).setString(PreferenceKeys.USER_TIMEZONE, 'America/Chicago')
}

 

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events