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

mihan ayeshana May 2, 2012

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
JamieA
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.
May 3, 2012

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 vote
Jobin Kuruvilla [Adaptavist]
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.
May 2, 2012

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!

mihan ayeshana May 2, 2012

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

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.
May 2, 2012

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
Ramiro Pointis
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.
May 2, 2012

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.

0 votes
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.
May 2, 2012

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.

mihan ayeshana May 2, 2012

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

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.
May 2, 2012

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.

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.
May 2, 2012

As above. DO NOT AMEND THE DATA.

mihan ayeshana May 2, 2012

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

mihan ayeshana May 2, 2012

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

Jobin Kuruvilla [Adaptavist]
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.
May 2, 2012

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

Ramiro Pointis
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.
May 2, 2012

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

Ramiro Pointis
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.
May 2, 2012

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 ;)

mihan ayeshana May 2, 2012

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 :)

Ramiro Pointis
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.
May 2, 2012

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

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.
May 2, 2012

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?

Ramiro Pointis
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.
May 2, 2012

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.

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.
May 2, 2012

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.
mihan ayeshana May 3, 2012

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

RambanamP
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.
May 3, 2012
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.
May 3, 2012

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.

mihan ayeshana May 4, 2012

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?

mihan ayeshana May 4, 2012

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

mihan ayeshana May 4, 2012

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

mihan ayeshana May 4, 2012

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

Suggest an answer

Log in or Sign up to answer