Automate JIRA Refresh Process Between Environments(Prod/Dev)

Hi,

We have 2 JIRA environments(test,production). We would like to automate the process of refreshing the test environment using different values for example(application links, general URL, delete mail server).

I came up with the following process...

1. Create a backup of JIRA prod database (Powershell with SQL Server Module)
2. Store backup file in shared location
3. Stop services for JIRA Training Environment
4. Restore database using (Powershell SQL Server Module)
5. Archive log files (Shared Location)
6. Perform specific training instance updates

6.a Delete the Mail Server (DELETE FROM dbo.mailserver where ID in (10010, 10031);)
6.b UPDATE dbo.propertystring SET propertyvalue='http://testenv.jira.mycompany.com' WHERE ID=10012;
6.c DELETE FROM dbo.notificationscheme where ID in(10000, 10021, 10032, 10040, 10171, 10270, 10370, 10371);

7. Update Application Link for Confluence Test Environment (PENDING)
8. Reindex (PENDING)

Question
----------

How do we reindex or update the application link if there is no API or Database Table that holds this data.

1 answer

We have the same type of situation there, and we usually don't bother re-indexing.

I am not sure whether it's missing in your steps or if it's implied, but JIRA is using some file system storage as well (in the Applicaiotn Data\JIRA folder for us).

In those folders, you will have things such as :

  • Attachments
  • Plugins
  • Indexes
  • Avatars

So we are usually copying this folder (a zipped version) from production to test environment as well.

As well, in your point 6b, I believe you need to repoint the database in the dbconfig.xml file (part of that famous folder) rather than changing it in the database. It's kind of a chicken and egg problem, the configuration for the database accessed by JIRA cannot be in the database, because JIRA needs this information before accessing the database.

Copying the folder will take care of your indexing, as the indexes will be copied over from production, so we usually don't bother rebuilding them (since it's test, not too many people are using it and load is not an issue).

No advice for application links, as we are not using those.

I was trying to remove an application link using the selenium-webdriver ruby gem.

require "selenium-webdriver"

driver = Selenium::WebDriver.for :chrome, :switches => %w[--ignore-certificate-errors --disable-popup-blocking --disable-translate --ash-immersive-fullscreen ]
driver.navigate.to 'http://jira.mycompany.com/secure/Dashboard.jspa'

driver.switch_to.frame "gadget-0"

puts "Title: #{driver.title}"

element = driver.find_element(:id, 'login-form-username')
element.clear
element.send_keys "myusername"

element = driver.find_element(:id,'login-form-password')
element.clear
element.send_keys "mypassword"

element = driver.find_element(:name,'login')
element.click

wait = Selenium::WebDriver::Wait.new(:timeout => 10)
wait.until { driver.title.start_with? "CM/Quality" }

puts "Title: #{driver.title}"

element = driver.find_element(:link_text,'Administration')
element.click

wait = Selenium::WebDriver::Wait.new(:timeout => 10)
wait.until { driver.title.start_with? "JIRA Administration" }

element = driver.find_element(:link_text,'Application Links')
element.click

element = driver.find_element(:id,'login-form-authenticatePassword')
element.clear
element.send_keys "mypassword"

element = driver.find_element(:name,'authenticate')
element.click

wait = Selenium::WebDriver::Wait.new(:timeout => 10)
wait.until { driver.title.start_with? "Application Links" }

#driver.click("css=a[class=app-delete-link]")
#element = driver.find_element(:link_text,'Delete')
#element.click

driver.save_screenshot("jira.png")

puts driver.inspect

Still need to figure out the Delete click and Add a new application link.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,334 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot