Closed AndreyGorloff closed 2 years ago
Hi,
You should use this code in BEFORE SAVE section:
self.custom_field_values = {'100' => self.parent.custom_field_value(100).to_s}
If you are using the code in AFTER SAVE section, then you should save the values:
self.custom_field_values = {'100' => self.parent.custom_field_value(100).to_s}
self.save_custom_field_values
Do not forget to change the custom field id (100) to your custom field id!
I hope it helps!
Thanks a lot. Very helpful.
AirTibu
AirTibu, we have some requirements. Can we talk somewhere on telegram, whatsap, skype?
Hi,
You should use this code in BEFORE SAVE section:
self.custom_field_values = {'100' => self.parent.custom_field_value(100).to_s}
If you are using the code in AFTER SAVE section, then you should save the values:
self.custom_field_values = {'100' => self.parent.custom_field_value(100).to_s} self.save_custom_field_values
Do not forget to change the custom field id (100) to your custom field id!
I hope it helps!
Sorry, Tried to do this, got the error:
lib/redmine/sudo_mode.rb:61:in sudo_mode' I, [2022-06-23T14:01:35.390510 #1] INFO -- : Started PATCH "/custom_workflows/2" for 84.39.247.99 at 2022-06-23 14:01:35 +0000 I, [2022-06-23T14:01:35.391607 #1] INFO -- : Processing by CustomWorkflowsController#update as HTML I, [2022-06-23T14:01:35.391708 #1] INFO -- : Parameters: {"utf8"=>"✓", "authenticity_token"=>"xaWcWabcN205n3kffd6JrNM2ZQQJtfz8QGJ8Vr2UKw3O64GXO8uHs81W0iStbijhi4XRAawodBxMxZfe94/7tA==", "custom_workflow"=>{"name"=>"set parent field", "author"=>"", "description"=>"", "is_for_all"=>"1", "active"=>"1", "project_ids"=>[""], "before_save"=>"", "after_save"=>"self.custom_field_values = {'14' => self.parent.custom_field_value(14).to_s}\r\n\r\nself.save_custom_field_values", "before_destroy"=>"", "after_destroy"=>""}, "mce_0"=>"", "commit"=>"Save", "id"=>"2"} I, [2022-06-23T14:01:35.415718 #1] INFO -- : Current user: gprog@mail.ru (id=35) I, [2022-06-23T14:01:35.431019 #1] INFO -- : = Running shared code for Issue (#) " #: " I, [2022-06-23T14:01:35.432052 #1] INFO -- : = Finished running shared code for Issue (#) " #: " I, [2022-06-23T14:01:35.442303 #1] INFO -- : Completed 500 Internal Server Error in 50ms (ActiveRecord: 24.3ms) F, [2022-06-23T14:01:35.443137 #1] FATAL -- : F, [2022-06-23T14:01:35.443315 #1] FATAL -- : NameError (uninitialized constant #<Class:0x000055cc1f89d438>::WorkflowError Did you mean? WorkflowRule): F, [2022-06-23T14:01:35.443362 #1] FATAL -- : F, [2022-06-23T14:01:35.443396 #1] FATAL -- : plugins/redmine_custom_workflows/app/models/custom_workflow.rb:113:in
rescue in validate_syntax_for'
Where could be the issue? I tried the AFTER SAVE option.
It's a bug in the plugin. You should update it to it's latest release v2.0.3. It's related to #261.
thanks. will try
Seems like it's related to 2.0.4 version. https://github.com/anteo/redmine_custom_workflows/issues?q=is%3Aclosed+milestone%3A2.0.4 I experienced this issue on 2.0.3 version
AirTibu
AirTibu, we have some requirements. Can we talk somewhere on telegram, whatsap, skype?
I'm not a programmer, so I don't even use the preferred communication channels in the IT world, but if you think so, you can reach me here: airtibu2@gmail.com
You are right. Sorry. v2.0.4 released.
@AndreyGorloff check your mailbox, I sent you answer.
I need to inherit parent task's custom field values to child issue. Sorry, I'm noob in ruby.