Forums

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

Create Multiple group in database

Rilwan Ahmed
Community Champion
March 7, 2018

I want to create around 100 groups in jira internal directory. Is there any easy way to do it rather manually adding group from UI ?  I mean from groovy script or INSERT query (Database) ?

2 answers

0 votes
Rilwan Ahmed
Community Champion
March 8, 2018

We use groovy runner internal plugin. 

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 7, 2018

Definitely not by touching the database.  What scripting add-on do you have?

Rilwan Ahmed
Community Champion
March 8, 2018

Groovy Script

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2018

Which one?  I know of  4 that use Groovy one way or another.

Rilwan Ahmed
Community Champion
March 8, 2018

We use groovy runner internal plugin. 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2018

Please, tell us which one.

Rilwan Ahmed
Community Champion
March 8, 2018

I dont know which one exactly. It is developed by our internal team. 
Sample code which runs there:

/* getAllUsersCount.groovy */
/* calculate all the user count */

import com.atlassian.jira.user.ApplicationUser

Iterator<ApplicationUser> userIterator = userManager.getUsers().iterator()
int count = 0
while (userIterator.hasNext()) {
userIterator.next()
count++
}

println(count)

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2018

Ok, there's not a lot I can tell you, as we have no idea of the capabilities of that, including where it runs.

You'll need something like GroupManager.AddGroup() calls, but I can't do a lot else for you.

Suggest an answer

Log in or Sign up to answer