Interaction with console
Added by Luís Eterovick over 11 years ago
Can i change an issue status from console or by making a custom script?
Replies (1)
RE: Interaction with console - Added by Jean-Baptiste Barth over 11 years ago
Yes, in a console, let's say you want to turn issue 5 in status number 4 :
Issue.find(5).update_attribute(:status_id, 4)
Maybe you don't know the "4" but just the name of the new status you want to set. Let's say it's called "Closed", then :
status_id = IssueStatus.find_by_name("Closed") Issue.find(5).update_attribute(:status_id, status_id)
Of course both approaches can break if you remove the status in Redmine administration panel but don't update your script, or if you change the name of the status...