Group question

Rumceisz May 14, 2012

Hi All,

we manage in our Jira all the companies divisions employees. This means that when we create a new user account we add them to the divisionA and to the Employee group. In the case of a different user from Division B we add them to divisionB group and then to the Employee. This Employee group is obligatory because it serves issue security aims (other group is Customers).

Hence we have to add the users more and more groups, is there a feature which automatically add the Employee group to the user when we add them to one of the division group? Maybe a script or something.

For instance: I create a user, add the user to the DivisonB group and it will be added automatically to the Employee group.

Can you please suggest?

Note, that the nested groups is not a solution, hence it significantly slow up our application!

Thanks in advance!

Rumi

2 answers

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
May 14, 2012

It is easy to script your process using addUser and addUserToGroup using the JIRA Command Line Interface. Create a file with of all the add actions you need. Then use the run action with findReplace parameter to replace the specific user id with a script reference like @newUser@.

Rumceisz May 14, 2012

Hi, is there a script also for this feature?

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
May 14, 2012

No, you create a custom script suitable for the groups you need to deal with. Something like:

--action addUser --userId @userId@ --userFullName "@userName@" --userEmail @userEmail@
--action addUserToGroup --userId @userId@ --group Employee 
--action addUserToGroup --userId @userId@ --group @division@
...

Then you would run it when a new user was needed using something like:

--action run --file myscript.txt --findReplace "@division@:DivisionA,@userId@:newUser,@userName@:New UserName,@userEmail@:newUser@domain.com"

Rumceisz May 15, 2012

Hi Bob,

can this script run for instance in every 5 minutes?

I mean I would like to achieve that in the case of new user creation, I would have to add the user to only 1 specific group (division group) and then the user will be automatically add to the Employees group, Internal group and confluence group (these 3 are our standard groups to which all employees has to be added.)

Using CLI is same effort as picking these 3 groups when creating a user, or not?

Thanks!

Rumi

0 votes
JamieA
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.
May 14, 2012

Some sort of service to run every few mins to synchronise the groups I guess. There is no "user added to group" event afaik that you could listen for.

Suggest an answer

Log in or Sign up to answer