Adds convert_to_ticket quick action
What does this MR do and why?
Contributes to Create Service Desk tickets from the UI and API (#433376 - closed)
convert_to_ticket_quick_action
.
This merge request introduces a new quick action for issues, called /convert_to_ticket user@example.com
. This action allows users to convert an existing issue into a Service Desk issue.
This is the first iteration on this so this MR doesn't:
- add a system note that states that an external participant has been added (can only be done after !141612 (merged) has been merged)
- add a system note that the issue has been converted
- support using the quick action on an unpersisted issue
- actually convert to the work item type
ticket
but changes the issue so it's a Service Desk issue per definition of today
What makes a Service Desk issue
It's a regular issue (long term migration to work item type ticket
), but
- Author is the
GitLab Support-Bot
(Users::Internal.support_bot
) -
service_desk_reply_to
is populated with an email address - (technically optional) at least one
IssueEmailParticipant
has been added (normally the address fromservice_desk_reply_to
field) - (technically optional) is confidential (can be made public again).
Issue update query
We call update!
on the issue. This is the query and the query plan:
UPDATE "issues" SET "author_id" = 46, "updated_at" = '2024-01-31 14:40:57.994593',
"confidential" = TRUE, "service_desk_reply_to" = 'user@example.com'
WHERE "issues"."id" = 669
Update on issues (cost=0.57..3.58 rows=0 width=0)
-> Index Scan using issues_pkey on issues (cost=0.57..3.58 rows=1 width=51)
Index Cond: (id = 669)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Quick action autocomplete
Internal comment after transformation
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_email
orservice_desk_email
for email ingestion, please add this to yourgitlab.yml
file in thedevelopment:
section. Please restart GDK withgdk restart
:incoming_email: enabled: true address: "incoming+%{key}@example.com"
- Select a project and enable the feature flag for
convert_to_ticket_quick_action
.project = Project.find(7) Feature.enable(:convert_to_ticket_quick_action, project)
- Add a new issue in the project.
- Now add a new comment and start typing
/convert_to_ticket user@example.com
. The Autocomplete should list theconvert_to_ticket
command. - Submit the comment and see the success message and a new internal comment from
GitLab Support-Bot
that mentiones the original author of the issue and the email address that has been added as the external author. - Reload the issue to see all Service Desk ticket details (email address is listed in header and warning below comment editor that external participants will be notified).
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.