Create issue in the new project via Custom WorkFlow plugin

Added by Nikolai Efimov-Soini about 2 years ago


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:

  1. = before_save = #
    if custom_field_value(59) == "1"
    @need_create = true
  1. = after_save = #

if @need_create

idd = self.project.project_id
issue1 =
: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?