Expose type field from the issues REST API
In https://gitlab.com/gitlab-org/gitlab-triage/-/merge_requests/205 it's a hot fix to overwrite the type field from the issues REST API, meaning that we are not exposing this value from the actual response.
We should use internal type and field instead of hijacking type. For example:
def attach_resource_type(resources, resource_type)
resources.each do |resource|
resource[:gitlab_triage_resource_type] = resource_type
end
end
However, we also need to keep backward compatibility to some extent so that {{type}}
can work like before.
def attach_resource_type(resources, resource_type)
resources.each do |resource|
resource[:gitlab_triage_resource_type] = resource_type
resource[:type] ||= resource_type
end
end
However the value of {{type}}
will change, so it's not fully backward compatible. Do we want to make {{type}}
preserve the previous value?