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 generated an API key.
Authentication
The Surveys for JSM REST API uses the same authentication as the Jira API authentication. For more information, check out Atlassian Developers documentation.
Accessing the endpoint
Enable the API in the Configure tab of your survey settings, for more information read, Set up in-app automation triggers, goal evaluators, and custom fields.
Add the ‘x-api-key’ to your header with the generated API key.
Access endpoint via
curl H "x-api-key:<insert_API_Key_here>" <insert_endpoint_here>
or via API Platform tools such as Postman, WSO2, and others.
GET Method
Retrieving Surveys for JSM results
Surveys for JSM REST API return the survey results when requested with the endpoint parameters below.
https://surveys-jsm.servicerocket.io/surveys?projectKey=my-project-key&responded=true
This example shows the results returned by the API call. In this scenario, there is one block of data as the total number of surveys in that month was one.
{
"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
}
By default, the endpoint parameter returns only one month’s worth of results. Use the “from” and “to” parameter to control the range of the results. For example:
https://survey-jsm.servicerocket.io/surveys?projectKey=my-project-key&responded=false&from=2023-02-02&to=2023-04-29
Endpoint Parameters
key | required | content type | value |
---|---|---|---|
projectKey | yes | string | The project that is associated with the surveys. |
from | no | string | The starting date range of the surveys. Default: If no value is passed, there will be a 30-day cut-off point for the endpoint. |
to | no | string | The ending date range of the surveys. Default: If no value is passed, there will be a 30-day cut-off point for the endpoint. |
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 |
Response Code
Code | Definition |
---|---|
200 | Returned if the request is successful. |
400 | Access is not enabled or the API key is invalid |