Project

General

Profile

Can I update status issues directly on the issues table through SQL?

Added by Boris Chavez-Bravo about 13 years ago

Hello,

I am wondering whether I can perform updates through SQL directly on the issues table on MySQL. Specifically, I am interested in updating the status field for some issues. However, somebody mentioned that this may cause a problem when trying to upgrade to a newer version of Redmine later. Is this true? I have checked the relationships with the issues table, but I cannot find anything else that links to it, which would cause any future problems. Having said that, I do not know how Redmine stores information on files.

Anyone has any ideas?

Thanks.


Replies (4)

RE: Can I update status issues directly on the issues table through SQL? - Added by Etienne Massip about 13 years ago

I don't think this will cause any problem to update the status_id field by SQL ; note that you can already update several issues statuses at a time with the contextual menu of the issue list, what's your exact need ?

RE: Can I update status issues directly on the issues table through SQL? - Added by Boris Chavez-Bravo about 13 years ago

Basically, all I need to do is automate the way that issues get flagged as being ready to test. Every time a deployment is performed, I need to scan the subject field for every issue with status '2', and if I find some text like 'Fixed issue ###", I should update those issues with status 'Y' (as an example). I want to put my SQL statement in a simple script that accomplishes this.

update issues
set status_id = 5
where status_id = 3
and subject like 'Fixed%'

(something like that)

RE: Can I update status issues directly on the issues table through SQL? - Added by Etienne Massip about 13 years ago

You'll loose mail notification, won't see any status change in the issue journal or in the activity report. If you update status to a closed one, you'll loose done ratio computation of parent issues, etc.

A proper way to do it would be to get the list of issues to be updated via REST API and update those issues still vie REST API.

Guess that can be done quickly with minimal js coding.

RE: Can I update status issues directly on the issues table through SQL? - Added by Boris Chavez-Bravo about 13 years ago

I tried Rest API, but it has a problem updating status for issues (see: redmine-java-api/issues/detail?id=25)

I also tried the e-mail option, but I am not a network administrator, so I am not well versed on setting up mail servers. Also, the documentation I found on this is very scarce and not well detailed. Do you have better docs to follow, to setup POP mail servers to talk to Redmine? It is another option...

Regards.

    (1-4/4)