Book Image

Jira 8 Administration Cookbook - Third Edition

By : Patrick Li
Book Image

Jira 8 Administration Cookbook - Third Edition

By: Patrick Li

Overview of this book

Jira is a project management tool used widely by organizations to plan, track, and release software. Jira administrators are at the heart of these processes and need to know how to successfully administer and customize Jira offerings. This updated Jira 8 Administration Cookbook demonstrates how to efficiently work with Jira Core and Jira Service Desk. The book starts with a variety of recipes to help you manage users and workflows. You'll learn how to set up custom forms and capture important data with custom fields and screens. Next, you'll gain insights into the latest email capabilities, which will assist you with everything from managing outgoing email rules to processing incoming emails for automated issue creation. Later, you'll be guided through running scripts to automate tasks, getting easy access to logs, and even working with tools to troubleshoot problems. The book will also ensure you understand how to integrate Jira with Slack, set up SSO with Google, and delegate administrator permissions. Finally, a dedicated section on Jira Service Desk will enable you to set up and customize your own support portal, work with internal teams to solve problems, and achieve optimized services with Service Level Agreement (SLA). By the end of this book, you'll have the skills you need to extend and customize your Jira implementation effectively.
Table of Contents (11 chapters)

Resetting the Jira administrator password

Sometimes, you might forget or lose the password to the account with the Jira administrator or Jira System Administrator permission, and you cannot retrieve it using the password reset option. For example, suppose Jira does not have an SMTP server configured, or you restored Jira from a data dump and do not know the account and/or password. In these cases, you need to reset the administrator password directly in the database.

This recipe only applies to Jira instances that use the default internal user directory option. External user management, such as LDAP, will not work with this recipe.

Getting ready

As we will reset the password stored in Jira's database, make sure you do the following:

  • Connect to the Jira database via either the command line or a GUI.
  • Update the Jira database records.

How to do it...

Let's assume we use the default mysql command-line tool and MySQL as the backend database for Jira. If you are using a different database, you may need to change the following SQL statements accordingly:

  1. Connect to the Jira database with a client tool by running the mysql -u jirauser -p command, where jirauser is the username used by Jira to access the Jira database.
  2. You can find Jira's database details from the dbconfig.xml file located in JIRA_HOME.
  3. Change to the Jira database by running the use jiradb command, where jiradb is the name of Jira's database.
  4. Determine the groups that have the Jira System Administrator global permission with the following SQL statement:
select perm_parameter from 
schemepermissions where PERMISSION=44;
  1. Find users that belong to the groups returned in the previous step by running the following SQL statement, where jira-administrators is a group returned from the previous step:
select child_name, directory_id
from cwd_membership where
parent_name='jira-administrators';
The jira-administrators group is the default group that administrators belong to. You might get a different group if you customize the permission configurations. The table column for the username is child-name.
  1. Reset the user's password in the database with the following SQL statement, where admin is a user returned in the previous step:
update cwd_user set
credential='uQieO/1CGMUIXXftw3ynrsaYLShI+
GTcPS4LdUGWbIusFvHPfUzD7
CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==' where
user_name='admin';
  1. Restart Jira to apply the change.

How it works...

With Jira's internal user directory, all user and group data is stored in the Jira database. The value 44 is the ID of the Jira System Administrator global permission.

If you do not know which groups or users are granted the Jira System Administrator global permission, you will first have to find this information using steps 4 and 5. Otherwise, you can skip to step 6 in order to reset the password.

Jira's user password is stored in the cwd_user table. As Jira only stores the hash value of the password, we changed the user's admin password hash to uQieO/1CGMUIXXftw3ynrsaYLShI+GTcPS4LdUGWbIusFvHPfUzD7CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==, which is the UTF-8-encoded hash value of sphere.