I'm trying to write a request in postman to add a comment to a Jira issue while also mentioning the reporter without knowing who the reporter of said issue is.
So far, this is my request URL:
https://{{server-name}}/rest/api/latest/issue/{{issue-key}}/comment
and I've tried the following bodies:
{
"body": "[~accountId:{{reporter.accountId}}] this is a test comment"
}
{
"body": "[~accountid:{{issue.reporter.displayName}}] this is a test comment"
}
{
"body": "[~accountId:{{reporter.displayName}}] this is a test comment"
}
based on various other documentations/community help articles I've found.
However, all of these examples just come into my Jira issue as plain text (where the reporter is not resolving to actually mentioning the reporter).
POST https://XYZ.atlassian.net/rest/api/3/issue/DPDV-8151/comment
{
"body": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This high priority ticket was not updated for 10 days."
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "mention",
"attrs": {
"id": "712020:f0f2e610-2376-424d-9ba7-169a956cf6e7"
}
},
{
"type": "text",
"text": ", "
},
{
"type": "mention",
"attrs": {
"id": "712020:f0f2e610-2376-424d-9ba7-169a956cf6e7"
}
},
{
"type": "text",
"text": ","
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Please share an update."
}
]
}
],
"version": 1
}
}
Its not adding comments, its just returning existing comments
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is what is working for me.
note to use POST, and not change the Account Id for your users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am trying to add comment via following api
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
POST > https://XYZ.atlassian.net/rest/api/3/issue/KEY/comment
The below:
Reporter <@{{1.reporter.accountId}}> or assignee <@{{1.assignee.accountId}}>
FYI - this case was not updated for a while.
is translated into:
{
"body": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Reporter "
},
{
"type": "mention",
"attrs": {
"id": "62f60645c1b3a10ac3acf642"
}
},
{
"type": "text",
"text": " or assignee "
},
{
"type": "mention",
"attrs": {
"id": "62f60645c1b3a10ac3acf642"
}
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "FYI - this case was not updated for a while."
}
]
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You cannot combine these two events in one API call.
When you are using the POST call to
https://{{server-name}}/rest/api/latest/issue/{{issue-key}}/comment
This is API call for adding the comments to the ticket only and ignores other data.
For updating the reporter, you should be using the PUT call to
https://{{server-name}}/rest/api/latest/issue/{{issue-key}}
and provide the following data in the 'Body' section:
{
"fields": {
"reporter": {
"name": "name of the reporter",
"emailAddress": "email address",
"displayName": "Full name"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Thank you for the information, but updating the reporter of the issue is not in-scope of this question, I merely need to mention the current reporter of the issue in a comment without knowing any of the other details of the user who is the reporter alongside my comment text.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Christian Ludwig , have you sitting on any solution now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.