For developping and testing, the JIRA REST API Browser is a great help, because you can run the service calls directly form the GUI and can also see the URL that you need to generate. Unfortunately, this product has a bug that prevents it from working correctly with non-JIRA add-ons, so a patch is required.
JIRA REST API Browser
You can find this free add-on here: https://marketplace.atlassian.com/plugins/com.atlassian.labs.rest-api-browser.
The JIRA REST API Browser provides a GUI that shows the parameters and allows to run and test REST services:
Some more information can be found here: https://developer.atlassian.com/docs/atlassian-platform-common-components/rest-api-development/developing-a-rest-service-plugin
Patch the JIRA REST API Browser
Atlassian has added hard-coded information on the REST services that can be displayed via the JIRA REST Browser, so that, contary to the documentation, services of other add-ons are not displayed. THis bug basically applies when installing the JIRA REST Browser in a non-development environment, if you are using the JIRA REST API Browser as part of a JIRA SDK, it might work correctly (or not).
You can work around this bug with the following patch:
# download plugin (https://marketplace.atlassian.com/plugins/com.atlassian.labs.rest-api-browser): # extract files (js) unzip rest-api-browser-3.0.x.jar assets/rab/rest-api-browser.min.js assets/rab/services/rest_resources_service.js # add icbiz in: assets/rab/rest-api-browser.min.js var JIRA_PUBLIC_APIS=["^json-rpc/","^api/2","^auth/","^activities/","^icbiz/"] # add icbiz in: assets/rab/services/rest_resources_service.js var JIRA_PUBLIC_APIS = [ '^json-rpc/', '^api/2', '^auth/', '^activities/', '^icbiz' ]; # update Jar-file jar -uf rest-api-browser-3.0.x.jar assets/rab/rest-api-browser.min.js assets/rab/services/rest_resources_service.js
(replace 3.0.x by the version you are using)
This patched version should also display the services starting with icbiz/.
Example (Work Log Report, /rest/icbiz/1.0/worklog/report)
Go to the respective service and populate the mask with the criteria you want to filter your report (see /icbiz/1.0/worklog/report). In our example, we want to get all work logs for
- a defined project
- in a defined date range
- that have not yet been charged.
Click on send to get the results.
You will see the URL
https://example.com/myjira/rest/icbiz/1.0/worklog/report?projectKey=GHJ&dateFrom=2013-10-01&dateTo=2013-11-30&accountingStatus=NOT_INVOICED
as well as the results of this call
{ "responseType": "OK", "fieldErrors": [], "errMsgs": [], "expand": "activityType", "data": { "responseType": "OK", "fieldErrors": [], "errMsgs": [], "data": { "worklogListRest": [ { "issue": { "clazz": "de.iconcept.icbiz.api.entities.IssueRest", "key": "GHJ-1", "id": 12402 }, "created": "2013-11-03 11:07:22", "timeSpent": 1860, "worklogId": 12828, "startDate": "2013-11-03", "calcTime": 0, "approved": true, "noChargeInfo": "no charge, just some general research", "priceListId": 27, "invoiced": false, "acticityTypeId": 4, "chargeable": true, "activityTypeName": "Design & Usability", "priceListName": "TBD", "authorUserName": "john", "clazz": "de.iconcept.icbiz.api.entities.WorklogRest", "comment": "favicon er ......12828", "startTime": "2013-11-03 11:09:18", "endTime": "2013-11-03 11:09:18" }, { "issue": { "clazz": "de.iconcept.icbiz.api.entities.IssueRest", "key": "GHJ-1", "id": 12402 }, "created": "2013-10-21 11:07:22", "timeSpent": 1860, "worklogId": 12691, "startDate": "2013-10-21", "calcTime": 0, "approved": true, "priceListId": 27, "invoiced": false, "acticityTypeId": 4, "chargeable": false, "activityTypeName": "Design & Usability", "priceListName": "TBD", "authorUserName": "john", "clazz": "de.iconcept.icbiz.api.entities.WorklogRest", "comment": "Preparing ......12691", "startTime": "2013-10-21 11:09:18", "endTime": "2013-10-21 11:09:18" }, ], "clazz": "de.iconcept.icbiz.api.entities.WorklogReportRest" }, "clazz": "de.iconcept.icbiz.api.response.ResponseIct" }, "clazz": "de.iconcept.icbiz.api.response.ResponseIct" }
Should there be errors, they will be displayed:
{ "responseType": "EXCEPTION", "fieldErrors": [], "errMsgs": [ { "errorMsg": "Invalid DateFormat for 20131001" } ], "clazz": "de.iconcept.icbiz.api.response.ResponseIct" }