Allow custom award emoji through the API
What does this MR do and why?
This change allows users to award custom emoji to issues/MRs/comments.
Screenshots or screen recordings
How to set up and validate locally
-
Enable the
custom_emoji
feature flag -
Make sure you've added custom emoji.
- You can do this through the GraphQL API:
- Browse to
/-/graphql-explorer
- And type and run:
mutation { createCustomEmoji(input: { groupPath: "gitlab-org", name: "troll", url: "https://upload.wikimedia.org/wikipedia/en/9/9a/Trollface_non-free.png"}) { clientMutationId errors customEmoji { name } } }
- Browse to
- Or on the Rails console:
CustomEmoji.create(namespace: Group.first, name: 'troll', file: 'https://upload.wikimedia.org/wikipedia/en/9/9a/Trollface_non-free.png', external: true, creator: User.first)
- You can do this through the GraphQL API:
-
Visit any issue. And get the API URL for that issue, being
<group>%2f<project>/issues/<iid>
-
Award a custom emoji using
curl
:curl -L --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "http://gdk.test:8080/api/v4/projects/flightjs%2fFlight/issues/6/award_emoji?name=troll"
-
Visit the issue again, and see the awarded emoji.
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 Toon Claes