create new user with sql query

Pumper1 December 19, 2017

hi,

I wont to create new users directly from database, how i can do it? maybe somebody have done sql query?

1 answer

1 accepted

2 votes
Answer accepted
Alexey Matveev
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.
December 19, 2017
Pumper1 December 19, 2017

Thanks for your answer, but can i do it with sql? I use Jira server

Alexey Matveev
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.
December 19, 2017

You should not use SQL to modify any data in Jira. Your Jira will become unreliable and prone to errors and unexpected behaviour

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2017

For SQL inserts:

  • Take your Jira service down.
  • Take a full backup of the database with your database tools.
  • Restore this on a test system to ensure it is valid.
  • Run the SQL to hit the 4-8 tables you need to amend/insert into
  • Restart Jira
  • Re-index it
  • Test every area of user interaction works for an old user and the new one
  • In 99.99% of cases, roll back the backup you took earlier because testing fails and you've found you've got a broken Jira.

But seriously, use REST.

Pumper1 December 20, 2017

Thank you. Maybe you have some guides how to do it with REST?

Alexey Matveev
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.
December 20, 2017

Kindly read the documentation I provided.

You should execute POST /rest/api/2/user with payload

{ "name": "charlie", "password": "abracadabra", "emailAddress": "charlie@atlassian.com", "displayName": "Charlie of Atlassian", "applicationKeys": [ "jira-core" ] }

That is all you should do.

Pumper1 December 27, 2017

Thank you

Suggest an answer

Log in or Sign up to answer