Reporter Name or ID via JIRA REST API

Hi,

I’m looking at the REST API documentation and was wondering if there’s any way to retrieve the email or account ID of the reporter in a Jira ticket via this method.

Thanks

Hello @GinnaKhang ,

You do not mention what resource you are using.
One can get the reporter of an issue with get Issue /rest/api/3/issue/{issueIdOrKey}

Have a look at the expand parameter and the self in response objects.
This may require more than one call if I am misinterpreting your requirement

def issueKey = 'PRJKEY-123'
def result = get("/rest/api/latest/issue/$issueKey").asObject(Map)

def reporter = result.body.fields.reporter

// reporter.emailAddress
// reporter.accountId

return reporter

Response

{
  "self": "redacted",
   "accountId": "redacted",
  "emailAddress": "redacted",
  "avatarUrls": {
    "48x48": "redacted",
    "24x24": "redacted",
    "16x16": "redacted",
    "32x32": "redacted"
  },
  "displayName": "Graham Twine",
  "active": true,
  "timeZone": "Africa/Johannesburg",
  "accountType": "atlassian"
}