I want to extract reporter name using REST API.
GET http://localhost:8080/rest/api/2/issue/awd-1?fields=reporter
If I used command above I get the following extract:
{ "expand": "renderedFields,names,schema,transitions,operations,editmeta,changelog", "id": "10000", "self": "http://localhost:8080/rest/api/2/issue/10000", "key": "AWD-1", "fields": { "reporter": { "self": "http://localhost:8080/rest/api/2/user?username=username", "name": "username", "emailAddress": "user@domain.com", "avatarUrls": { "16x16": "http://localhost:8080/secure/useravatar?size=small&avatarId=10122", "48x48": "http://localhost:8080/secure/useravatar?avatarId=10122" }, "displayName": "User Name", "active": true } } }
Now I want to get the reporter name from extract above.
You can use below code :
httpClient.get(`rest/api/3/issue/${res.req.query.issueKey}`, function (err, response, body)
{
let get_reporter_data = JSON.parse(body);
let displayName = get_reporter_data.fields.reporter.displayName;
console.log("reporter Name is ",displayName);
});
Hey,How to get reporter's email address?I am not getting email address from above API?
Can you please do help me on this?
It looks like you're new here. Sign in or register to get started.