Create API for Timeline Event
What does this MR do and why?
Contributes to #344059 (closed)
Adds a GraphQL mutation to create timeline events.
Screenshots or screen recordings
Mutation | Result |
---|---|
Mutation
Mutation GraphQL query
mutation CreateTimelineEvent($input: TimelineEventCreateInput!) {
timelineEventCreate(input: $input) {
timelineEvent {
id
author { id username }
updatedByUser { id username }
incident { id title }
note
noteHtml
editable
promotedFromNote { id body }
action
occurredAt
createdAt
updatedAt
}
errors
}
}
Query variables
{
"input": {
"incident_id": "gid://gitlab/Issue/509",
"note": "Note",
"occurredAt": "2022-01-19T12:22:42Z"
}
}
How to set up and validate locally
-
Make sure you have the license installed.
-
Create an incident manually by navigating to Monitor > Incidents from the left sidebar menu of your GitLab project.
-
Find the global id of the Issue and pass in the input params of the GraphQL query.
-
Run the above GraphQL query inside
http://localhost:3000/-/graphql-explorer
-
Check
IncidentManagement::TimelineEvent.find(<ID>)
in therails console
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.
Edited by Rajendra Kadam