anteo / redmine_custom_workflows

Allows to create custom workflows for Redmine
http://www.redmine.org/plugins/custom-workflows
GNU General Public License v2.0
178 stars 72 forks source link

How to change status if Done ratio is changed to 100 #307

Closed SinghNanak closed 9 months ago

picman commented 1 year ago

Issue::before_save

if self.done_ratio == 100
  self.status_id = 5
end
SinghNanak commented 1 year ago

i had tried that earlier but then i cannot change issue status

picman commented 1 year ago

That is strange. I've tested it and it worked. Verify that the issue status ID and done_ration exist in your system. And also check the log for any errors. You can also add some debug messages to find out what went wrong, e.g.:

Rails.logger.info ">>> #{self.status.name}"
AirTibu commented 1 year ago

i had tried that earlier but then i cannot change issue status

Hi,

Usually this issue is occur when you have field, which is mandatory according to your workflow, but it is empty. In this case, the status won’t be changed. Check your workflow first!

I hope it helps!