I am creating this questions in response to Atlassian's lack of bulk tools to process JIRA content. I will supply the solution so other people can learn from my experience.
Install the following from marketplace:
Download the latest CLI client from https://bobswift.atlassian.net/wiki/display/ACLI/CLI+Client+Installation+and+Use
Extract the contents inside the server in a folder.
Modify the file jira.bat so the --server, --user and --password fields are populated
java -jar "%dirPath%"/lib/jira-cli-6.0.0.jar --server http://server.dev.domain.com:80 --user sysadmin --password sysadmin %*
verify java.exe is in the Windows path (C:\Program Files\Atlassian\JIRA\jre\bin)
@echo off
rem remember the directory path to this bat file
set dirPath=%~dp0
call jira.bat --action getProjectList --outputFormat 2 --file groups-export.csv
pause
@echo off
rem remember the directory path to this bat file
set dirPath=%~dp0
For /F "usebackq tokens=1 delims=," %%a in (projects-delete.csv) Do (
call jira.bat --action deleteProject --project "%%a" --continue
)
pause
@echo off
rem remember the directory path to this bat file
set dirPath=%~dp0
call jira.bat --action getGroupList --file groups_export.csv
pause
@echo off
rem remember the directory path to this bat file
set dirPath=%~dp0
For /F "usebackq tokens=1 delims=," %%a in (groups_delete.csv) Do (
call jira.bat --action removeGroup --group "%%a" --continue
)
pause
@echo off
rem remember the directory path to this bat file
set dirPath=%~dp0
call jira.bat --action getUserList --name "@all" --outputFormat 2 --file users-export.csv --includeInactive
pause
@echo off
rem remember the directory path to this bat file
set dirPath=%~dp0
For /F "usebackq tokens=1 delims=," %%a in (users-delete.csv) Do (
call jira.bat --action removeuser --userId "%%a" --continue
)
pause
I can't quite get the 'delete users from a CSV file' to function, are you able to provide further info of what should be directly entered into the CLI? (java.exe in in correct path, jira.bat file updated with necessary details)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Cameron,
"delete users from a CSV file" is an example batch script file (.BAT or .CMD extension) that takes user names to delete from a CSV file called "users-delete.csv"
This CSV file is actually generated from the "get list of users to CSV file" script. You will need to masage the CSV file to remove any users you want to keep before moving to the delete phase, as well as remove any redundant data from it so the delete script can take only usersnames as input.
Edit1:
The script that exports users to CSV has many columns
User,Key,Name,Email,Time Zone,Avatar URL,Active,Groups
You need to remove every column exctept "User".
Edit2:
"get list of users to CSV file" scrip creates users-export.csv
This file has many columns.
User,Key,Name,Email,Time Zone,Avatar URL,Active,Groups
You need to remove every column except "User" then save the file as users-delete.csv
This new file can be used as input for "delete users from a CSV file" script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @George Bica, Profields in its recent release allows performing bulk delete projects including their "orphan" schemes. Also allows to bulk change roles, components, project lead, and category.
Cheers,
David
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.