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:
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%40atlassian.com", name: "anton@atlassian.com", emailAddress: "anton@atlassian.com", avatarUrls: { 16x16: "https://jira.atlassian.com/secure/useravatar?size=xsmall&ownerId=anton%40atlassian.com&avatarId=15399", 24x24: "https://jira.atlassian.com/secure/useravatar?size=small&ownerId=anton%40atlassian.com&avatarId=15399", 32x32: "https://jira.atlassian.com/secure/useravatar?size=medium&ownerId=anton%40atlassian.com&avatarId=15399", 48x48: "https://jira.atlassian.com/secure/useravatar?ownerId=anton%40atlassian.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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
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.