Project

General

Profile

custom workflow plugin

Added by Christian R over 2 years ago

I'm trying to prevent creation of a Task or Bug without a parent task. I created a custom workflow plugin and it seems to work but raising the workflowerror appears in the log file but it does not show any notification when saving nor preventing the save of issue

if self.parent_id.blank? && (self.tracker_id == 5 or self.tracker_id == 6 ) then
    raise WorkflowError, 'Tasks and Bugs must have a parent issue.' unless errors.blank?
    end

Replies (3)

RE: custom workflow plugin - Added by Christian R over 2 years ago

Solved, just copied the example from the documentation without checking.

if self.parent_id.blank? && (self.tracker_id == 5 or self.tracker_id == 6 ) then
    raise WorkflowError, 'Tasks and Bugs must have a parent issue.'
    end

RE: custom workflow plugin - Added by Marius BĂLTEANU over 2 years ago

Is not better to make the parent task field mandatory in the workflow for that trackers?

RE: custom workflow plugin - Added by Christian R over 2 years ago

Didn't think about that. Thanks!

    (1-3/3)