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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.