Batch User Management

Name Batch User - Group - Create / Delete
Version 0.1
Product Versions 0.1
Author(s) Chris Robsahm
Homepage  
Price free
License OpenSource
JavaDocs  
IssueTracking  
Download JAR http://confluence.atlassian.com/download/attachments/167182519/jiraUserMgmt.jar
Download Source http://confluence.atlassian.com/download/attachments/167182519/jiraUserMgmtSrc.jar

Description/Features

With this utility you can do batch imports of users with a CSV file. You can create or delete users / groups. Input is a CSV file and output is a JellyScript which you can past into Jelly Runner

Installation

This is not really a plugin its a Java Application which you execute, the output is a Jelly Fish script,

Usage

There are two different modes of operation for this utility. First is stand alone mode and second is batch mode (import). In stand alone mode you create a script on a per user or per group basis, in import mode you use a CSV file to create a batch import
The order of all operations on the command line does not matter
Stand Alone Usage:

operation=createUser with this tag there are several required and optional operations.
required :

userID=<userID> this is the user which will be created in Jira

userName=<userName> this is the full name of the user to be associated with the user
eMail=<eMail> the email addres for this user
optional : groups=<group1,group2,groupx> a comma separated lists of groups to associate with this user, if they do not exist they are created

operation=DeleteUser deletes the user from Jira, providing that the user has no issues assigned to them

required : userName=<userName> the user name of the user to delete

operation=CreateGroups creates user groups
required : groups=<group1,group2,groupx> a comma separated lists of groups to create

operation=DeleteGroups deletes user groups
required: groups=<group1,group2,groupx> a comma separated lists of groups to delete, only deletes a group if it has no users in it.

Bath Mode Usage: This mode creates a script to create or delete a group of users from a CSV file.
operation=createUser with this tag you create a group of users from a CSV file.
required: importscript=<file>
optional: groups=<group1,group2,groupx> a comma separated lists of groups to associate with this user, if they do not exist they are created

operation=deleteUser with this tag you delete a group of users from a CSV file.
required: importscript=<file>
The syntax of the CSV files is:<lastName>,<firstName>,<userID>,<eMail>

Examples

Example: Stand Alone create user : operation=createUser userID=myUser userName=\"John Smith\" email=john.smith@abc.com groups=group1,group2,group3,groupx
Example: Stand Alone delete user : operation=deleteUser userID=myUser
Example: Batch create user : operation=createUser importscript=<filename> groups=group1,group2,groupx

Version History

Open Issues

Screenshots

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Dec 03, 2008

    Charles Albrecht says:

    It's not at all clear to me how this script would be executed.

    It's not at all clear to me how this script would be executed.

  2. Jan 22

    Laszlo Radics says:

    It generates a Jelly script from command line, e.g.: C:\Users\radicsl\Downloads...

    It generates a Jelly script from command line, e.g.:

    C:\Users\radicsl\Downloads>java -cp jiraUserMgmt.jar jira.user.mgmt.JiraUserManagmentScript operation=deleteUser userID=aa script=bb
    C:\Users\radicsl\Downloads>type bb

    I was trying to use it for deleting groups, but it does not seem to work on even the latest JIRA version, the RemoveGroup Jelly tag exists, but it does not delete the group, even it is empty.

    Another problem is that if the -importscript parameter preceeds -script, then the application overwrites <importscript> with an empty Jelly script (because of careless parameter checking).

  3. Mar 05

    Jarkko Tamola says:

    Hi! Would be great if I could figure out how to use it! Not so clear&#...

    Hi!

    Would be great if I could figure out how to use it!

    Not so clear!

    Anyone? Examples?

    Regards

    Jarkko

  4. Jul 02

    Carl Slaughter says:

    There is an undocumented (or poorly documented) aspect to this tool. When you a...

    There is an undocumented (or poorly documented) aspect to this tool.

    When you are testing this for teh first time you may try one of the examples provided in the /h option.

    "Example: java -jar jiraUserMgmt.jar operation=createUser userID=myUser userName="John Smith" email=john.smith@abc.com groups=group1"

    This example would result in teh following error.

    "ERROR : script paramater not defined, see help for use cases, run utility with /? or /h"

    But what is not well documented is that the peramater "script=filename.txt" is required. This tells the script where to send the output to. I like many assumed the comand would dump the output to the screen so I could do a copy-n-paste.

    So the corrected example looks like this.

    "java -jar jiraUserMgmt.jar operation=createUser userID=myUser userName=\"John Smith\" email=john.smith@abc.com groups=group1 script=filename.txt"

    Now thefilename.txt file that was created will contain teh following.

    <JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.JiraTagLib">
    <jira:CreateUser username="myUser" password="initial" confirm="initial" fullname="" email="john.smith@abc.com">
    <jira:AddUserToGroup group-name="group1"/>
    </jira:CreateUser>
    </JiraJelly>

    I hope this helps. As I am only interested in teh user and group creating aspect of this tool, I have not yet tested any other functionality.

    Carl