Issue created from alert doesn't include group labels in template
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Group labels do not get added to an issue created with a template via the Alert monitoring integration.
I think it could be that the Authorization key used to create the alert doesn't have access to the Group labels.
The problem does not occur when creating the issue manually and assigning a template in the UI. It seems like creating the issue from the alert/incident, and creating via the UI, both use the Issues::CreateService, and this would refer to the template to create the issue description content. If there's no difference in how that is processed, the problem could be access related.
Steps to reproduce
- Create a top-level group, a subgroup, and a project in the subgroup
- Create 3 labels at the top-level group
- Create an incident template in the project that adds the three labels
- For the project, turn on creating incidents automatically whenever an alert is triggered, and select the template
- Set up a HTTP or Prometheus monitoring endpoint
- Use the Endpoint URL and Authorization key to create an alert
- Check the issue description created from the alert/incident
Example Project
What is the current bug behavior?
Issue is created with template, but labels are not added
What is the expected correct behavior?
Issue is created with template and labels are added
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Workaround
Although technically possible to workaround the issue, some customers have indicated this workaround is not feasible for them to implement.
- Remove the labels from the top-level group
- Add the labels in the project where the incident template is