Closed bhetsko closed 1 year ago
Check the type of customfield 117. It should be multivalues user type.
Thank you!! I don't even remember changing it from multivalue. Is there a Before Save code that will support the single value option? For now, I will keep as multivalue. Thanks again.
Hi,
You should manage both types with below code. First you should test the CustomField, that it has multivalues or not:
if CustomField.find(CF_ID).multiple?
@notify_users = Issue.find(@issue.id).custom_field_value(CF_ID).uniq.sort != @issue.custom_field_value(CF_ID).uniq.sort if @issue.id
else
@notify_users = Issue.find(@issue.id).custom_field_value(CF_ID) != @issue.custom_value_for(CF_ID).try(&:value) if @issue.id
end
Note: Do not forget to change the CF_ID.
I hope it helps!
For some reason I now get an error with this workflow element (Reference Issue #216).
== Custom workflow exception: undefined method 'uniq' for "117":String
in the production.logThe @notify_users... code provided in issue #216 worked fine for a while so I'm not sure what may have changed. I posted this question originally in that thread but it was closed, so I don't think anyone was monitoring it.
Appreciate any help.
_Originally posted by @bhetsko in https://github.com/anteo/redmine_custom_workflows/issues/216#issuecomment-1460862188_