Select default Service Desk ticket visibility
What does this MR do and why?
Contributes to #33091 (closed)
We received feedback that the first action agents perform on a Service Desk ticket is to mark it as non-confidential. This is the first of three MRs that aim to add a setting that allows to set the default confidentiality of Service Desk tickets. The default will stay confidential. Maintainers can set this setting to non-confidential|public but only if the project is either private or internal so we don't expose newly created tickets to the public.
Planned MRs
-
🎯 Add DB field and logic - Add field to API controller
- Add field to frontend Service Desk settings
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- If you haven't set up
incoming_emailorservice_desk_emailfor email ingestion, please add this to yourgitlab.ymlfile in thedevelopment:section. Please restart GDK withgdk restart:This will allow you to see the Service Desk section in the settings and generate project-specific email addresses. You won't be able to ingest real emails, but we don't need that here.incoming_email: enabled: true address: "incoming+%{key}@example.com" - Select a project and enable the feature flag for
issue_email_participants.project = Project.find(5) # Use a PRIVATE project please puts "project #{project.name} is public? #{project.public?} should be false." Feature.enable(:service_desk_tickets_confidentiality, project) - Ingest a sample email which will create an issue in the selected project.
service_desk_address = project.service_desk_incoming_address email_raw = <<~EMAIL To: #{service_desk_address} From: user@example.com Subject: Confidential SD issue This should create a new confidential issue. EMAIL EmailReceiverWorker.new.perform(email_raw) - Because the setting
tickets_confidential_by_defaultis set totrueby default, all new Service Desk tickets will be confidential. The ingested email from step 2 created an issue. Let's fetch this and check whether it's confidential (current behavior).issue = Issue.last puts "#{issue.title}: confidential? #{issue.confidential?} should be true" - Now set the setting to
false, so new tickets will be public for non-public projects.ServiceDeskSettings::UpdateService.new(project, User.first, tickets_confidential_by_default: false).execute - Repeat steps 3) and 4) or use this modified snippet. This time the new issue shouldn't be confidential.
email_raw = <<~EMAIL To: #{service_desk_address} From: user@example.com Subject: Non-confidential SD issue This should create a new public issue. EMAIL EmailReceiverWorker.new.perform(email_raw) issue = Issue.last puts "#{issue.title}: confidential? #{issue.confidential?} should be false" - Now select a project that is public. You can use this modified snippet or the steps above. Tickets in public projects should always be confidential.
public_project = Project.find(7) # Use a PUBLIC project please puts "project #{public_project.name} is public? #{public_project.public?} should be true." Feature.enable(:service_desk_tickets_confidentiality, public_project) ServiceDeskSettings::UpdateService.new(public_project, User.first, tickets_confidential_by_default: false).execute service_desk_address = public_project.service_desk_incoming_address email_raw = <<~EMAIL To: #{service_desk_address} From: user@example.com Subject: Confidential SD issue This should create a new confidential issue although the setting says it should not be confidential. EMAIL EmailReceiverWorker.new.perform(email_raw) issue = Issue.last puts "#{issue.title}: confidential? #{issue.confidential?} should be true" - (Optional) Rollback project and FF changes:
ServiceDeskSettings::UpdateService.new(project, User.first, tickets_confidential_by_default: true).execute ServiceDeskSettings::UpdateService.new(public_project, User.first, tickets_confidential_by_default: true).execute Feature.disable(:service_desk_tickets_confidentiality, project) Feature.disable(:service_desk_tickets_confidentiality, public_project)
Edited by Marc Saleiko