SQL UPDATE problem after Trac import

shinyidol July 2, 2011

The priorities didn't set right when doing a Trac import, so I am just updating them via SQL. Sadly my UPDATE is changing all issues, and not the ones I want.

I want update priority based on what the stringvalue in a customefield. This is what I tried and it just updated priority for all issues.

UPDATE
jiraissue
SET priority = 1
From customfieldvalue
WHERE customfieldvalue.stringvalue = 'Blocking'

Any suggestions

1 answer

2 votes
Colin Goudie
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.
July 2, 2011

You need a valid join from jiraissue to customfieldvalue don't you. Something like

update jiraissue SET priority=1 where id in (select ji.id from jiraissue ji join customfieldvalue cfv on cfv.ID = ji.ID where cfv.stringvalue = 'Blocking');
 

Suggest an answer

Log in or Sign up to answer