Hi people
I want to insert serveral rows in JIRAISSUE table with sql INSERTS
If I do it I get a PRIMARY KEY error so I need to know where JIRA gets its PK
I read that the table PROJECT has a field called pcounter which pointed the next value of the key but if I do
SELECT PROJECT.pname,
pcounter,
COUNT (*),
MAX (JIRAISSUE.id),
MIN (JIRAISSUE.id),
MAX( JIRAISSUE.pkey),
MIN( JIRAISSUE.pkey),
MIN (workflow_id),
MAX (workflow_id)
FROM JIRADBUSER.JIRAISSUE, JIRADBUSER.PROJECT
WHERE project.id = JIRAISSUE.project
GROUP BY PROJECT.pname, pcounter;
the values don't seem right
Does anybody know where the ID field of JIRAISSUE gets its value from?
Thanks in advance
Baltasar
Why would you want to do that? I suggest that you describe what you're trying to achive and get help here on how to do it. Playing around with Jira DB doesn't seem safe and there are ways to do stuff in a more reasonable manner (Java API, REST, plugins etc.)
The reason to do that is easy, because I've been asked to
If you don't know the answer fine but don't tell me I'm not reasonable, if is safe or not is up to me to decide. Don't answer if you don't have anything helpful to say
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry if you got my message this way, wasnt my intention to judge what you're trying to do.
Still it's hard for me to believe that you were asked to use SQL inserts, my guess would be that you want some issues registered in Jira and you want to do it by script instead of by hand (maybe forcing some values or whatever). Of course I could be wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @simar. Swiniak's comment was with good intentions. I guess no one in the community here will be really for manipulating database directly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>I want to insert serveral rows in JIRAISSUE table with sql INSERTS
No, you do not. (Well, there are edge cases, but "no, you don't" is the case 99.999% of the time) Two reasons.
Reason 1: Process - when changing data in a Jira database with SQL, the process is
Do NOT use SQL on a running Jira installation. It is suicidal - I can guarantee that you WILL damage the data, and potentially render it unusable. You also have significant downtime to deal with.
Reason 2: The data you are inserting
If you are wanting to add a Jira issue, you can't just add to the issue table. You've spotted the project table, but you also need to change the counters in the sequence table, and then the workflow tables. If you want to create an issue with any custom fields, versions, components worklogs, etc, then you've got yet more tables to push data into.
What you need to do now
Other bits
>I read that the table PROJECT has a field called pcounter which pointed the next value of the key but if I do
>the values don't seem right
What do you think is wrong with them?
>If I do it I get a PRIMARY KEY error so I need to know where JIRA gets its PK
>Does anybody know where the ID field of JIRAISSUE gets its value from?
Yes, because you aren't inserting the other data it needs. The value is generated by looking at the previous data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your answers
I'll have to look for another way to solve the problem I've been assigned
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good move. If you tell us what you're trying to do, we can probably help guide you to a good solution or at least share any tricks/pitfalls.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
there is also the command line plugin that may work for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And if you are looking at bulk imports, this may help
http://confluence.atlassian.com/display/JIRA/Importing+Data+from+CSV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.