Create issue in the new project via Custom WorkFlow plugin
I want to create an issue when user create new project and select custom field (id=59) by means the Custom WorkFlow plugin. I used the following code:
- = before_save = #
if custom_field_value(59) == "1"
@need_create = true
- = after_save = #
idd = self.project.project_id
issue1 = Issue.new(
:author => User.current,
:project => Project.find(idd),
:tracker_id => 1,
:status_id => 2,
:subject => "1Subtask",
:description => "Description")
Unfortunately, this code doesn't work - I can't find the project. On the other hand, I can create a new issue in the other project(created before), using Project.find("created_project_name").
How I can translate some information (project_id, project identifier, project name etc.) to my new issue? Or maybe I can get this information in the after_save window?
Does anyone have a solution to create an new issue with the project?