Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I mention someone in a ticket using REST?

Kristian ASK October 27, 2023

I'm creating a ticket but also want to mention a user in the description. I know the email. Do I have to look the user id before being able to mention?

When mentioning the user from the UI it turns up like this

{
type: "paragraph",
content: [
{
type: "mention",
attrs: {
id: "[user id]",
text: "@My Users Name",
accessLevel: "",
},
},
{
type: "text",
text: " ",
},
],
}

 

3 answers

1 accepted

0 votes
Answer accepted
Kristian ASK October 30, 2023

Yes... I need to provide the id of the user...

0 votes
vftjhj sdsfnhfh November 1, 2023

In a RESTful API context, mentioning someone in a ticket typically involves sending a request to the server to associate a user with a specific ticket or include them in some kind of notification system. The specific implementation details can vary based on the API and platform you're working with, but generally, you would use HTTP methods (like POST or PATCH) to update or create a ticket with the mentioned user.

Here's a general example using HTTP POST:

```http
POST /api/tickets/:ticketId/mentions
Content-Type: application/json

{
"mentionedUserId": "123",
"message": "Hey, could you take a look at this ticket?"
}
```

In this example:

- `POST /api/tickets/:ticketId/mentions` is the endpoint for mentioning someone in a ticket. You would replace `:ticketId` with the actual identifier of the ticket.

- `Content-Type: application/json` indicates that the request body will be in JSON format.

- The JSON payload includes the `mentionedUserId` field, representing the ID or unique identifier of the user you want to mention.

- The `message` field can contain an optional message to accompany the mention.

Keep in mind that this is a simplified example, and the actual implementation details can vary depending on the API specifications or conventions used by the system you're working with. It's recommended to consult the API documentation of the service you're integrating with for accurate and detailed information on how to mention someone in a ticket using their REST API.

0 votes
Mohamed Benziane
Community Champion
October 27, 2023

Hi,

This seems correct to me. You can also take a look at this thread

https://community.atlassian.com/t5/Jira-Software-questions/Rest-API-v3-Add-Mention-to-Comment/qaq-p/1213708

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events