Rest API return data is too limited or too much

rama chakka August 4, 2013

I am using rest api to search for issues using a custom field. I am only getting the key and self fields back. I wanted additional fields like status, assignee etc. Based on the example given here

https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Query+issues I am passing the fields=.. query parameters with the request and i still get the same two fields key and id. This is the sample return value.

{"startAt":0,"maxResults":50,"total":1,"issues":[{"self":"http://jirahost.com/rest/api/latest/issue/ISSUE100","key":"ISSUE100"}]}

If I try to get the details of the issue, I get way too much information like fieldnames, types etc etc. Here is the example of the return value when I query one issue.

"expand":"html","self":"http://jira.mycompany.com/rest/api/latest/issue/ZZZZZZZZ-87","key":"ZZZZZZZZ-87","fields":{"summary":{"name":"summary","type":"java.lang.String","value":"XXXXXX - Convert to IOD when available"},"timetracking":{"name":"timetracking","type":"com.atlassian.jira.issue.fields.TimeTrackingSystemField"},"issuetype":{"name":"issuetype","type":"com.atlassian.jira.issue.issuetype.IssueType","value":{"self":"http://jira.mycompany.com/rest/api/latest/issueType/2","name":"New Feature","subtask":false}},"customfield_10428":{"name":"QA Estimate","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield","value":"8"},"customfield_10427":{"name":"Dev Estimate","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield","value":"8"},"customfield_10521":{"name":"Total Estimate","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield"},"customfield_10520":{"name":"T-Shirt Size","type":"com.atlassian.jira.plugin.system.customfieldtypes:select"},"customfield_10426":{"name":"BA Estimate","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield","value":"4"},"customfield_10425":{"name":"Desired Release Date","type":"com.atlassian.jira.plugin.system.customfieldtypes:datepicker"},"reporter":{"name":"reporter","type":"com.opensymphony.user.User","value":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=XXXXXs","name":"XXXXXs","displayName":"Shayne XXXXX","active":true}},"customfield_10046":{"name":"CQ Product","type":"com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield"},"customfield_10045":{"name":"CQ Rational Project","type":"com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield"},"customfield_10432":{"name":"PM Estimate","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield","value":"2"},"customfield_10042":{"name":"CQ Customer","type":"com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield"},"updated":{"name":"updated","type":"java.util.Date","value":"2013-07-18T22:33:01.000-0500"},"created":{"name":"created","type":"java.util.Date","value":"2013-03-22T14:18:40.000-0500"},"customfield_10041":{"name":"IA Incident Number","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield"},"description":{"name":"description","type":"java.lang.String","value":"During the last year or so we have had a number of issues with IMS for XXXXX XXXXX. The problem specifically has been that URL's that we send result in 404's on their CPO website. This has been a known issue with our IMS product and in meeting with XXXXX Witt, XXXXX D and Mike Certain, it was mentioned that XXXXX would be a great candidate for our new IMS product IOD. This Jira is to request and track progress towards getting XXXXX XXXXX on IOD."},"priority":{"name":"priority","type":"com.atlassian.jira.issue.priority.Priority","value":{"self":"http://jira.mycompany.com/rest/api/latest/priority/3","name":"Major"}},"customfield_10044":{"name":"CQ Functional Area","type":"com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield"},"customfield_10043":{"name":"CQ Customer Tracking","type":"com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield"},"customfield_10001":{"name":"RM","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield","value":"30179"},"customfield_10002":{"name":"Found In","type":"com.atlassian.jira.plugin.system.customfieldtypes:select"},"customfield_10040":{"name":"CQ ID","type":"com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield"},"status":{"name":"status","type":"com.atlassian.jira.issue.status.Status","value":{"self":"http://jira.mycompany.com/rest/api/latest/status/5","name":"Resolved"}},"customfield_10090":{"name":"Triage Follow-Up Date","type":"com.atlassian.jira.plugin.system.customfieldtypes:datepicker"},"labels":{"name":"labels","type":"com.atlassian.jira.issue.label.Label","value":[]},"customfield_10220":{"name":"Global Rank","type":"com.pyxis.greenhopper.jira:gh-global-rank","value":51379},"customfield_10629":{"name":"PMO Category","type":"com.atlassian.jira.plugin.system.customfieldtypes:select","value":{"self":"http://jira.mycompany.com/rest/api/latest/customFieldOption/10261","value":"Client"}},"project":{"name":"project","type":"com.atlassian.jira.project.Project","value":{"self":"http://jira.mycompany.com/rest/api/latest/project/ZZZZZZZZ","key":"ZZZZZZZZ","name":"XXXXXXX CPO","roles":{}}},"customfield_10320":{"name":"Rank","type":"com.pyxis.greenhopper.jira:gh-global-rank","value":123209},"customfield_10050":{"name":"Requirement ID","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield"},"customfield_10720":{"name":"IT Estimate","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield","value":"4"},"components":{"name":"components","type":"com.atlassian.jira.bc.project.component.ProjectComponent","value":[]},"customfield_10010":{"name":"Tested In","type":"com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes"},"comment":{"name":"comment","type":"com.atlassian.jira.issue.fields.CommentSystemField","value":[{"self":"http://jira.mycompany.com/rest/api/latest/comment/293682","author":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=cXXXXX","name":"cXXXXX","displayName":"XXXXX XXXXX","active":true},"body":"How's the back?","updateAuthor":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=cXXXXX","name":"cXXXXX","displayName":"XXXXX XXXXX","active":true},"created":"2013-04-16T14:41:36.000-0500","updated":"2013-04-16T14:41:36.000-0500"},{"self":"http://jira.mycompany.com/rest/api/latest/comment/293998","author":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=jXXXXX","name":"jXXXXX","displayName":"XXXXX XXXXX","active":true},"body":"I put the IT estimate also. 4 hours dev, 4 hours IT, once rides.ca is live on IOD first.","updateAuthor":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=jXXXXX","name":"jXXXXX","displayName":"XXXXX XXXXX","active":true},"created":"2013-04-17T11:42:36.000-0500","updated":"2013-04-17T11:42:36.000-0500"},{"self":"http://jira.mycompany.com/rest/api/latest/comment/294683","author":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=eXXXXX","name":"eXXXXX","displayName":"XXXXX XXXXX","active":true},"body":"Since this is the first implementation, BA estimate is uncertain...","updateAuthor":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=eXXXXX","name":"eXXXXX","displayName":"XXXXX XXXXX","active":true},"created":"2013-04-22T11:40:37.000-0500","updated":"2013-04-22T11:40:37.000-0500"},{"self":"http://jira.mycompany.com/rest/api/latest/comment/295004","author":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=cXXXXX","name":"cXXXXX","displayName":"XXXXX XXXXX","active":true},"body":"Scaling will be an issue.","updateAuthor":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=cXXXXX","name":"cXXXXX","displayName":"XXXXX XXXXX","active":true},"created":"2013-04-23T13:38:30.000-0500","updated":"2013-04-23T13:38:30.000-0500"},{"self":"http://jira.mycompany.com/rest/api/latest/comment/295007","author":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=cXXXXX","name":"cXXXXX","displayName":"XXXXX XXXXX","active":true},"body":"We need to make sure IOD is completed which includes IT making the appropriate changes to use the video cards. At this time, this isn't in place and the appropriate QA load testing has not been completed.","updateAuthor":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=cXXXXX","name":"cXXXXX","displayName":"XXXXX XXXXX","active":true},"created":"2013-04-23T13:40:53.000-0500","updated":"2013-04-23T13:40:53.000-0500"},{"self":"http://jira.mycompany.com/rest/api/latest/comment/295047","author":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=bouthilj","name":"bouthilj","displayName":"Jeff XXXXX","active":true},"body":"Shayne - If you would like to move forward with this work please update the JIRA to PMO workgroup and work with AD/XXXXX D to prioritize.\r\n\r\nJeff","updateAuthor":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=bouthilj","name":"bouthilj","displayName":"Jeff XXXXX","active":true},"created":"2013-04-23T14:15:48.000-0500","updated":"2013-04-23T14:15:48.000-0500"},{"self":"http://jira.mycompany.com/rest/api/latest/comment/295126","author":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=XXXXXs","name":"XXXXXs","displayName":"Shayne XXXXX","active":true},"body":"Assigning to the PMO queue. Mike Certain will reach out to XXXXX D. for prioritization.","updateAuthor":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=XXXXXs","name":"XXXXXs","displayName":"Shayne XXXXX","active":true},"created":"2013-04-23T15:51:40.000-0500","updated":"2013-04-23T15:51:40.000-0500"},{"self":"http://jira.mycompany.com/rest/api/latest/comment/301357","author":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=bouthilj","name":"bouthilj","displayName":"Jeff XXXXX","active":true},"body":"Can Ramma work on this?","updateAuthor":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=bouthilj","name":"bouthilj","displayName":"Jeff XXXXX","active":true},"created":"2013-05-21T13:32:45.000-0500","updated":"2013-05-21T13:32:45.000-0500"},{"self":"http://jira.mycompany.com/rest/api/latest/comment/301462","author":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=deckers","name":"deckers","displayName":"Sue Decker","active":true},"body":"This is something XXXXX can do. We aren't ready yet to add new customers to IOD. As soon as XXXXX gives us the green light, we will begin work. Creating a sub-task to get all requirements.","updateAuthor":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=deckers","name":"deckers","displayName":"Sue Decker","active":true},"created":"2013-05-21T17:08:36.000-0500","updated":"2013-05-21T17:08:36.000-0500"},{"self":"http://jira.mycompany.com/rest/api/latest/comment/303028","author":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=jXXXXX","name":"jXXXXX","displayName":"XXXXX XXXXX","active":true},"body":"XXXXX - please move the script to the DML tab on the RM, and tag it. You can use the 'Tag' link on the RM. ","updateAuthor":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=jXXXXX","name":"jXXXXX","displayName":"XXXXX XXXXX","active":true},"created":"2013-05-30T13:45:54.000-0500","updated":"2013-05-30T13:45:54.000-0500"}]},"customfield_10820":{"name":"Vendor","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield"},"customfield_10112":{"name":"Committed Date","type":"com.atlassian.jira.plugin.system.customfieldtypes:datepicker"},"customfield_10111":{"name":"Autoload Job ID","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield"},"customfield_10110":{"name":"Customer Change Order Number","type":"com.atlassian.jira.plugin.system.customfieldtypes:textfield"},"votes":{"name":"votes","type":"com.atlassian.jira.issue.fields.VotesSystemField","value":{"self":"http://jira.mycompany.com/rest/api/latest/issue/ZZZZZZZZ-87/votes","votes":0,"hasVoted":false}},"resolution":{"name":"resolution","type":"com.atlassian.jira.issue.resolution.Resolution","value":{"self":"http://jira.mycompany.com/rest/api/latest/resolution/1","name":"Fixed"}},"security":{"name":"security","type":"com.atlassian.jira.issue.security.IssueSecurityLevel"},"fixVersions":{"name":"fixVersions","type":"com.atlassian.jira.project.version.Version","value":[]},"resolutiondate":{"name":"resol... (Obsolete)","type":"com.atlassian.jira.plugin.system.customfieldtypes:float"},"customfield_10125":{"name":"Release Version History","type":"com.pyxis.greenhopper.jira:greenhopper-releasedmultiversionhistory"},"customfield_10121":{"name":"Epic/Theme","type":"com.atlassian.jira.plugin.system.customfieldtypes:labels"},"duedate":{"name":"duedate","type":"java.util.Date"},"watcher":{"name":"watcher","type":"watcher","value":{"self":"http://jira.mycompany.com/rest/api/latest/issue/ZZZZZZZZ-87/watchers","isWatching":false,"watchCount":5}},"customfield_10060":{"name":"Participants","type":"com.atlassian.jira.toolkit:participants"},"worklog":{"name":"worklog","type":"worklog","value":[]},"customfield_10100":{"name":"Work Queue Group","type":"com.atlassian.jira.plugin.system.customfieldtypes:grouppicker"},"assignee":{"name":"assignee","type":"com.opensymphony.user.User","value":{"self":"http://jira.mycompany.com/rest/api/latest/user?username=XXXXXr","name":"XXXXXr","displayName":"XXXXX XXXXX","active":true}},"links":{"name":"links","type":"issuelinks","value":[{"issueKey":"IMS-672","issue":"http://jira.mycompany.com/rest/api/latest/issue/IMS-672","type":{"name":"Reference","direction":"OUTBOUND","description":"relates to"}}]},"attachment":{"name":"attachment","type":"attachment","value":[]},"sub-tasks":{"name":"sub-tasks","type":"issuelinks","value":[{"issueKey":"ZZZZZZZZ-94","issue":"http://jira.mycompany.com/rest/api/latest/issue/ZZZZZZZZ-94","type":{"name":"Sub-Task","direction":"OUTBOUND"}},{"issueKey":"ZZZZZZZZ-95","issue":"http://jira.mycompany.com/rest/api/latest/issue/ZZZZZZZZ-95","type":{"name":"Sub-Task","direction":"OUTBOUND"}},{"issueKey":"ZZZZZZZZ-96","issue":"http://jira.mycompany.com/rest/api/latest/issue/ZZZZZZZZ-96","type":{"name":"Sub-Task","direction":"OUTBOUND"}}]},"versions":{"name":"versions","type":"com.atlassian.jira.project.version.Version","value":[]... RM","type":"com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes"}},"transitions":"http://jira.mycompany.com/rest/api/latest/issue/ZZZZZZZZ-87/transitions"}

7 answers

1 vote
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2013

What do you want? Too little? Too much? When will it be too little? When will it be too much? Don't worry about the data that you are not going to use. The overhead is not alot.

1 vote
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2013

I don't get what the problem is. A machine will read that rather quickly.

0 votes
Babeesh c November 22, 2013

hi rama,

for getting all details of an issue, you can use

"rest/api/2/search?jql=project=ISSUEKEY"

0 votes
rama chakka August 7, 2013

I am running a query using a similar rest url

http://kelpie9:8081/rest/api/2/search?jql=project=QA+order+by+duedate&fields=id,key,assignee,status

where in my case the jql is to query based on a custom field which we use for tracking a release. I want to get the issues that match that specific custom field.

The query is working fine and I am getting the matching issues. WHAT IS NOT WORKING IS, I ONLY GET THE ID AND KEY even though I specify other fields that I want like the assignee, summary, status etc.

0 votes
rama chakka August 4, 2013

Also in the examples, it says we can specify the fields we want in the response. Why is that functionality not working?

0 votes
rama chakka August 4, 2013

Well, my search could return anywhere around 50 issues. If I need to make another 50 calls to find the status of all the issues, it would be pretty crappy user experience even if the machines can process it quickly.

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 5, 2013

You just run one query and specify the data that you get. Why don't you tell us what's not working?

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 4, 2013

It's doing what it says on the tin, and giving you the details you've asked for. It's up to you to decide what to do with that data once it's been presented to you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events