Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Using page include from the support KB space to avoid duplicate pages

Description

This describes steps to use the JIRA CLI

Include Page
SUPPORTS:How to copy users
from one instance
to another
for either Server or Cloud instances. Copying all users or all user in a group to an new
instance
can be automated without scripting. If you need to select specific users, some manual or scripted steps may be needed to do the selection. Treat the techniques described here as examples that can be adjusted based on specific requirements.

Requirements

  • This requires CLI client version 7.0 or higher.
  • Customize your atlassian start script to include access to both JIRA instances (jira1 and jira2 in this example) and also to the CSV CLI.

Steps

...

Code Block
languagebash
titleAction
atlassian jira1 -a getUserList --outputFormat 999 --group jira-users --columns user,name,email,groups --file users.csv

Result File

Code Block
titleusers.csv
"User","Name","Email","Groups"
"admin","Administrator","admin@examplegear.com","jira-users,jira-administrators"
"bob","Bob Swift","bob@examplegear.com","jira-users,jira-administrators"
...

...

Code Block
atlassian csv -a copyCsv --sourceFile users.csv --file addUsers.csv --findReplace "User:userId,Name:userFullName,Email:userEmail,Groups:group"

Result file

Code Block
titleaddUsers.csv
"userId","userFullName","userEmail","group"
"admin","Administrator","admin@examplegear.com","jira-users,jira-administrators"
"bob","Bob Swift","bob@examplegear.com","jira-users,jira-administrators"
...

...

Code Block
atlassian jira2 --action runFromCsv --file addUsers.csv --common "-a addUser --continue" --continue

Result

...

SUPPORTS:How to copy users to another instance