Direct jira database changes are can not see in the jira UI

I access the jira database using sql script and i update the database. But i can not see the database changes in the jira user interface. I want to change the jira UI for those direct changes in database. How i can do it? Thanks.

4 answers

3 votes

If you install script runner plugin, you could run the clear jira caches script: https://studio.plugins.atlassian.com/wiki/display/GRV/Built-In+Scripts#Built-InScripts-ClearJIRAorGroovyCaches

If restarting makes it work, then probably this script will make it work too, without having to restart.

Having said that, I agree with the other comments telling you to use the API.

Most of the APIs you're looking for can be found in example code, eg the Copy Project script in the above plugin.

1 votes

What kind of changes are you making? Some needs reindexing and some needs restart! It is advised to make those changes after stopping JIRA anyway!

I did changes in Scheme in nodeassociation table. without restaring the jira is there a way to do it mate?

No, you've broken it. Stop Jira immediately, before it corrupts your data further.

You won't need to re-index, a restart should fix this, but test the projects you've amended right away.

0 votes

Arg. No.

You should never amend a Jira database while it is running (with some minor and very small exceptions). If it's offline, you can do more, but depending on the data you've changed, you almost certainly need to re-index afterwards. I suppose it's too late to tell you that you should also get a proven backup of your database before doing this...

Anyway, what *exactly* did you do to your data? Can you easily undo the changes?

I hope you have a backup? You may need it.

I reindex it but still not working. It works only restaring jira. How to solve it?

Yes, I know, that's very shouty. But I mean it - do not update the database directly. Use the API - code via SOAP, REST, plugin, Jelly, the UI, html posting. Just not SQL.

As above. DO NOT AMEND THE DATA.

Thing is API does not support to update some data in jira. thats why in using sql script to change the database.

Thing is API does not support to update some data in jira like Scheme in nodeassociation table. Then how i change it .?????

As @nic said, it is always better to go via the APIs. But in some cases, you will end up doing it in DB. Make sure you know what you are doing and do it when JIRA is offline. You can't escape from restarting JIRA (some of them works even without restart but I won't advise it in production!).

Sincerely, I've made changes directly with sql script, but you need to be extremely careful with this.

Like I said, there are possibilities that you will need to do a SQL script. In that case, you need to do a Jira backup, and a DB backup just in case, stop the jira service, do the changes, verify all is correct and restart the Jira service. Do some tests to verify all is good and go on. If something goes bad, you can restore the Jira or the DB and pray everything is fine ;)

Ya.. mate thats the way. But how can we do it if we have thousand of cusomenrs and thousand of projects. it's not practical thing to all ways to restart the jira. thats why im asking another way to do it mate :)

But always remember that Atlassian doesn't have warranty or support with this type of changes.

Er, the API does support changes to schemes. If it didn't, then the UI wouldn't allow you to change it - think of the UI as an Atlassian written front-end to data-structure. It *must* use the API to make all the changes, so the API must support what you're doing.

And to repeat myself again, you must not update the database while Jira is running. And be very careful even when it's not.

May we ask what you're actually trying to do?

Yep, that's always the issue. It seems the API doesn't need restart, but I'm not sure. I always had to stay late to do changes so I could stop Jira service easily.

Well, that's not an answer to the question I asked, so I can't go into any specific detail, but the general answer is:

  1. Suck it up and do it in the UI by hand
  2. Stop Jira. Take a backup. Prove the backup. Run the SQL. Start Jira. (And possibly reindex depending on the change)
  3. Code something that uses the API. As above. You can find lots of stuff to help with this - off the top of my head, look for the "script runner" and the "Jira CLI". They won't mean you can do it in the completely lazy SQL way (that's point 2), but they do make it a lot easier than having to write a huge block of Jelly xml or java code.

You said that if we can access Schemes in jira UI also we can access all them through API. Then can you help me to get those methods to throw API.

1.WorkflowScheme

2.Issue Type Screen Scheme

3.Field Configuration Scheme

4.Mail Configuration

These are the schemes which i want to find out methods to access throe API

Thanks

Rambanam just posted a better link than I'd had bookmarked.

You could probably get more help and advice if you told us what you're actually trying to do.

I did not get it. Can you elaborate it more. How can i add

1.WorkflowScheme

2.Issue Type Screen Scheme

3.Field Configuration Scheme

4.Mail Configuration

These scheme API accessible format?

I did not get it . Can you elaborate it more. How can i get

1.WorkflowScheme

2.Issue Type Screen Scheme

3.Field Configuration Scheme

4.Mail Configuration

scheme to API accessible format ? Code snap may be good reply

I did not get it . Can you elaborate it more. How can i get

1.WorkflowScheme

2.Issue Type Screen Scheme

3.Field Configuration Scheme

4.Mail Configuration

scheme to API accessible format ? Code snap may be good reply

I did not get it . Can you elaborate it more. How can i get

1.WorkflowScheme

2.Issue Type Screen Scheme

3.Field Configuration Scheme

4.Mail Configuration

scheme to API accessible format ? Code snap may be good reply

It's possible you need to restart the Jira Service. But @Jobin is right, you should be careful with the database changes and it is preferable that you do a back up before doing it.

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 ...

2,777 views 11 18
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