The Connector Create REST API, Fetch REST API and Synchronize REST API codes all share an Apex Class Parent Code which is provided below. This code will need to be included as a class before you are able to use the codes provided in the Create REST API, Fetch REST API and Synchronize REST API pages.
We have also included a Unit Test Code for this parent which you can find below.
Each REST API will also require three additional classes, if you want to run their respective Unit Test codes. These classes are also provided below.
All Apex Class codes provided are also provided on our Bitbucket Repository for your reference.
Apex Class parent code
The following class is necessary before implementing any Apex Classes for REST APIs:
Remember to change the following variables accordingly:
Your Jira URL
Your system Id in Connections. You can check this in Jira under Connections
Profile Name in Salesforce Profiles
Unit test code for this parent
To test the Apex Class parent code, you can use the following code:
Fixtures and mock objects
When implementing unit test codes for any of the REST APIs, you must also include the following three classes: