I'm trying to retrieve the assignee email address and project key from a JIRA search query via REST call - I can't seem to limit the returned fields to just theses 2 fields.
Example:
https://jira.atlassian.com/rest/api/2/search?startAt=2&jql=project%3DANERDS+and+updated+%3E+2013-04-29&fields=project,assignee&maxResults=2
will return
{ expand: "schema,names", startAt: 2, maxResults: 2, total: 38, issues: [ { expand: "editmeta,renderedFields,transitions,changelog,operations", id: "280877", self: "https://jira.atlassian.com/rest/api/2/issue/280877", key: "ANERDS-473", fields: { project: { self: "https://jira.atlassian.com/rest/api/2/project/ANERDS", id: "12510", key: "ANERDS", name: "Angry Nerds", avatarUrls: { 16x16: "https://jira.atlassian.com/secure/projectavatar?size=xsmall&pid=12510&avatarId=12492", 24x24: "https://jira.atlassian.com/secure/projectavatar?size=small&pid=12510&avatarId=12492", 32x32: "https://jira.atlassian.com/secure/projectavatar?size=medium&pid=12510&avatarId=12492", 48x48: "https://jira.atlassian.com/secure/projectavatar?pid=12510&avatarId=12492" } }, assignee: { self: "https://jira.atlassian.com/rest/api/2/user?username=anton@atlassian.com", name: "anton@atlassian.com", emailAddress: "anton@atlassian.com", avatarUrls: { 16x16: "https://jira.atlassian.com/secure/useravatar?size=xsmall&ownerId=anton@atlassian.com&avatarId=15399", 24x24: "https://jira.atlassian.com/secure/useravatar?size=small&ownerId=anton@atlassian.com&avatarId=15399", 32x32: "https://jira.atlassian.com/secure/useravatar?size=medium&ownerId=anton@atlassian.com&avatarId=15399", 48x48: "https://jira.atlassian.com/secure/useravatar?ownerId=anton@atlassian.com&avatarId=15399" }, displayName: "Anton Mazkovoi [Atlassian]", active: true } } },
Doing fields=project.key,assignee.emailAddress does not work either...
The fileds param is a list of fields to expand in response. So the above response for fields=project,assignee is correct (you got those two fields expanded).
There is no way to get only project key and assignee email address in JIRA REST API (for issue search results).
For custom fields:
fields=customfield_12345
Thank you, Aleksander! Is there a chance this feature to be included into API?
The problem is a user is forced to get tons of unnecessary info, and the goal is to get only needed info as fast as possible.
as per this comment, you can do this:&fields=-creatornot to retrieve the creator object
It looks like you're new here. Sign in or register to get started.