unique constraint "AO_54307E_VIEWPORTFORM_pkey" violated on project creation



In order to avoid tens of clicks on 200+ servicedesks, i executed a small SQL that adds an issue type to each servicedesk portal that does not have that issuetype (plus the fields and default values required).


Now, i cannot create new projects with CSV importer because :

org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "AO_54307E_VIEWPORTFORM_pkey"
Detail: Key ("ID")=(1917) already exists.



tried to create projects from GUI, same thing & same error (though, the ID increased)...


bouncing JIRA did not help.


select max(ID) from AO_54307E_VIEWPORTFORM

gave back 



i think i need to update some sequence in the sequence_value_item table, but i do not know which one...


anyone able to help?

1 answer

0 votes

It won't work, you've broken your installation.

It's a nice idea about the sequence_value_item, but it's not just that, or the relations in the SD tables.

Your best option is to revert to the backup you took before you did the changes.

Thanks Nic.


Or i can keep trying 100 times creating new project, then be back online as cached index will go above existing limit :(


Then I can import my next 400+ projects...


SD cloning is not available and in such setup with one SD per customer project means editing 200+ / 600+ projects everytime we do an evolution of the tool. 


any further ideas?




Scripting the creation of Service Desks should be possible.  That would be safe, as it would go through the API



That would be great, but i'm not a developer.


We use ScriptRunner indeed, but i have troubles understanding the deeps of JIRA & ServiceDesk while learning a new scripting language. I have no issues with BASH & PHP, SQL & JQL, database reverse engineering, but the Groovy is too much for the time I have to do this side of my duties...


If the SR's Copy project builtin function would also consider SD configuration items, then it might be a good thing for us at least...


Even better, if SR would be able to compare 2 projects (including their SDs) and apply the delta as compared to a reference project, that'll be wonderful. it will certainly ease many admin hours...


still opened to suggestions on how to fix this (DB/etc).

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Friday in Jira Service Desk

Are you a Jira Service Desk agent? We want to talk to you!

Are you a whiz at handling tickets and looking at how you can further optimize your workflow with automation? Do you tackle detailed customer support questions while simultaneously getting flooded wi...

142 views 0 8
Read article

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