Jira Database does not autoincrement remotelink primary key

Stefan Arnold
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.
June 8, 2017

Hey guys,

i tried to insert multiple remotelinks for a few thousand issue via database.

Everything worked fine, when i started Jira and checked the issues, each one has a correct working web link.

But now, when i try to create new web links out of jira, i get DataAccessExeption with the message that there is a duplicate entry for remotelink id 10000.

I know that remotelink id 10000 is the first starting id. So i started my inserted remotelinks with 10000. In database i now have remotelinks with ids from 10000 to 15000.

How can i tell jira to use 15001 as next remotelinkid and not 10000? so that i avoid duplicate entry error?

P.S. Reindexing didnt work. Also i could not find any information in database why jira wanna use the 10000 as next id.

1 answer

1 accepted

2 votes
Answer accepted
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.
June 8, 2017

You should *never* mess with an Atlassian database if you don't understand it in full.

I would go back to the backup you took before you did this, as you could now have corrupted quite a lot of things across your instance.

Stefan Arnold
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.
June 27, 2017

I totally accept your answer even if its not answering my question.

I made changes in database before i totally know whats the consequences.

But just as information for people that are like me, ive found a solution.
In the Jira Development Docs i found information about the database-schema and the sequence_value_item table. didnt recognized that before cause its "hidden".  docs say the following:

The SEQUENCE_VALUE_ITEM table

The SEQUENCE_VALUE_ITEM table is used to record, in a database independent way, the maximum ID used in each of JIRA's database tables

The implication of this is that if you want to manually insert records into JIRA database tables, you must update SEQUENCE_VALUE_ITEM yourself. Set the relevant rows' SEQ_ID values to a value greater than the actual maximum ID in the table. You will then need to restart JIRA to ensure all database caches are reset.

So i had to update the value for "RemoteIssueLink" and now everything is working fine.

Like Melwin Kieffer likes this
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.
June 27, 2017

And the other things you might have damaged?

Suggest an answer

Log in or Sign up to answer