url = custom_field.url_pattern.to_s.dup
url.gsub!('%value%') {URI.encode value.to_s}
url.gsub!('%id%') {URI.encode customized.id.to_s}
- url.gsub!('%project_id%') {URI.encode((customized.respond_to?(:project) ? customized.project.try(:id) : nil).to_s)}
- url.gsub!('%project_identifier%') {URI.encode((customized.respond_to?(:project) ? customized.project.try(:identifier) : nil).to_s)}
+ url.gsub!('%project_id%') {
+ URI.encode(
+ (customized.respond_to?(:project) ? customized.project.try(:id) : nil).to_s
+ )
+ }
+ url.gsub!('%project_identifier%') {
+ URI.encode(
+ (customized.respond_to?(:project) ? customized.project.try(:identifier) : nil).to_s
+ )
+ }
if custom_field.regexp.present?
url.gsub!(%r{%m(\d+)%}) do
m = $1.to_i