Trouble getting all fields for a ticket with the JSD REST API

Hello everyone,

I’ve been tasked with creating a utility for my company that will utilize the Jira Service Desk API to pull all ticket information on a daily basis that we can then process in our own proprietary software for analysis. However, I’m having some trouble getting all fields for a ticket in the response from the API.

Here’s the response I’m getting currently.
(Note: I’ve altered URLs and other potentially sensitive information in this response.)

{
  "_expands": [
    "participant",
    "status",
    "sla",
    "requestType",
    "serviceDesk"
  ],
  "issueId": "30441",
  "issueKey": "JSD-1227",
  "requestTypeId": "11",
  "serviceDeskId": "2",
  "createdDate": {
    "iso8601": "2017-01-10T14:29:59-0500",
    "jira": "2017-01-10T14:29:59.087-0500",
    "friendly": "10/Jan/17 2:29 PM",
    "epochMillis": 1484076599087
  },
  "reporter": null,
  "requestFieldValues": [
    {
      "fieldId": "summary",
      "label": "Summary",
      "value": "Test summary"
    },
    {
      "fieldId": "customfield_11500",
      "label": "",
      "value": []
    }
  ],
  "currentStatus": {
    "status": "Close",
    "statusDate": {
      "iso8601": "2017-01-10T14:29:59-0500",
      "jira": "2017-01-10T14:29:59.087-0500",
      "friendly": "10/Jan/17 2:29 PM",
      "epochMillis": 1484076599087
    }
  },
  "_links": {
    "jiraRest": ".../rest/api/2/issue/30441",
    "web": ".../servicedesk/customer/portal/2/JSD-1227",
    "self": ".../rest/servicedeskapi/request/30441"
  }
}

When looking at the “requestFieldValues” array in this object, you can see that I’m only getting values for the ticket summary and one of our custom fields. I’ve looked at permissions and settings for these fields and compared to other fields that aren’t coming through and I can’t seem to find anything that works to get other fields to be included in the responses. Has anyone else out there been able to find a way to get every field for a ticket via the API?

Hey Andrew,

If you are using the …/rest/servicedeskapi/request/ REST endpoint you will not get all the information from the ticket, only the information available in JSD.

If you use the …/rest/api/2/issue/ REST endpoint you will get all the issue information.

Both of those links can be found in the “_links” section of the reply you posted.

4 Likes

To add some color to @pvandevoorde - ServiceDesk add essentially adds a bunch of meta data to the JIRA issue. You’ll probably want to request both end points and merge the data (since you’re running analytics). Some of the mapping is explained at https://developer.atlassian.com/jiradev/jira-applications/jira-service-desk/guide-exploring-the-jira-service-desk-domain-model-via-the-rest-apis

1 Like

That works perfectly to go with the regular jira issue api call. Thanks for the help.

1 Like