Answer the question
In order to leave comments, you need to log in
How to programmatically create a task with a parent and get around the error Validation failed: Parent task is invalid?
Hello redmine experts!
I need fire support from the air with wise advice :)
I hung myself on the hook for adding a task and I want to create a subtask in another project.
In general, everything is ok. Except that I can not find a method of specifying the parent in any way.
I get an error: Validation failed: Parent task is invalid
The code is something like this:
# New mechanic
issue = Issue.new(
:author => @author,
:project => Project.find(@project_id_new_pc),
:tracker => Tracker.find(1),
:status => IssueStatus.find(1)
)
issue.subject = @subject
issue.parent_issue_id = @id
issue.save!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question