Developer guide
Here's how to access the results of surveys answered by customers.
Prerequisites
- You must be able to administer Jira global permission as mentioned in the Jira Cloud platform REST API documentation.
- You have configured the survey workflow as shown in the administrator guide.
- You have already generated an API key.
Authentication
The Surveys for JSM REST API uses the same authentication as the Jira API authentication. For more information, consult the Atlassian Developers documentation.
GET Method
Retrieving Surveys for JSM results
Surveys for JSM REST API can return the survey results when requested with the endpoint parameters below.
curl -H "x-api-key: XXXXX" https://survey-staging.xxxt.com/surveys?projectKey=your-project-key&responded=true
The example below shows an example where all the results were returned. You only see one data block as the total survey is only one in this scenario.
{ "issue_surveys": [{ "ces_response": 10, "comment_response": "Cool", "created": "2022-04-04T06:09:58", "issue_assignee": null, "issue_assignee_id": null, "issue_creation_date": 1649051994467, "issue_id": 10010, "issue_key": "LEV-11", "issue_reporter": "Team Lead Jane", "modified": "2022-04-04T06:14:26", "nps_response": 10, "project_key": "LEV", "response_date": "2022-04-04T06:13:57", "reviewer": "Mark Roberts", "reviewer_notes": "Approved", "scale_response": 9, "survey_id": "bb86cb87-332d-4f62-97ee-0896eb74792b-LEV" }], "total_surveys": 1, "total_surveys_responded": 1 }
Endpoint Parameters
key | required | content type | value |
---|---|---|---|
projectKey | yes | string | The project that is associated with the surveys. |
date_from | no | string | The starting date range of the surveys. Default: If no value is passed, there will be no cutoff point for the starting point. |
date_to | no | string | The ending date range of the surveys. Default: If no value is passed, there will be no cutoff point for the ending point. |
assignee | no | string | Filter the results by the assignee. Default: If no value is passed, the results won't be filtered by the assignee. |
responded | no | boolean | Whether surveys that only have been responded to should be returned. Default: false |