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

Script to switch status #316

Closed Fasterwolf closed 1 year ago

Fasterwolf commented 1 year ago

Hey I'm not much of a coder and been trying to figure out how to set a workflow to switch between two status.

When someone from group 9 leaves a note it changes to the status waiting for customer, status 8. When the author leaves a note changes to waiting for support, status 7.

Any help would be greatly appreciated.

AirTibu commented 1 year ago

Hi,

Use this code:


self.status_id = 8 if Group.find(9).users.include?(self.current_journal.user) unless new_record?

self.status_id = 7 if self.author == self.current_journal.user unless new_record? && self.current_journal.nil?

I hope it helps!