Writing Apex Class codes to call for Connector REST APIs
In addition to Endpoints, the Connector provides the ability to create Jira Issues using Connector REST APIs, which can be used in an Apex Class.
 This setup can only be used if your Jira instance is not behind a firewall.
Consult these related pages for more examples:
Connector REST API definition
The API can be described as:
Title | Item |
---|---|
HTTP Method | POST |
URL | <Jira URL>/rest/customware/connector/1.0/{systemId}/{objectType}/{objectId}/issue/create.{accept} |
Produces | APPLICATION_JSON |
Consumes | APPLICATION_JSON |
Data Input | { |
Using cURL, it can be constructed like this:
curl -i -H "Content-Type: application/json" -H "Authorization: Basic <64bit encoded username and password>" -X POST https://example.com/rest/customware/connector/1.0/1/Case/50090002N5r6/issue/create.json -d'{"project":"SFDC", "issueType":"1"}'
Description
The Connector provides three actions that can be performed in calling its REST APIs, namely:
Create
Synchronize
Fetch
They are all using a similar pattern of endpoint.
Endpoint:Â <Jira URL>/rest/customware/connector/1.0/{systemId}/{objectType}/{objectId}/issue/{action}.{accept}
Action | HTTP method | Produces | {action} | Example | Data Input |
---|---|---|---|---|---|
Create | POST | APPLICATION_JSON | create | https://example.com/rest/customware/connector/1.0/1/Case/50090002N5r6/issue/create.json | {Â |
Synchronize | PUT | APPLICATION_JSON | synchronize | https://example.com/rest/customware/connector/1.0/1/Case/50090002N5r6/issue/synchronize.json | - |
Fetch | GET | APPLICATION_JSON | fetch | https://example.com/rest/customware/connector/1.0/1/Case/50090002N5r6/issue/fetch.json | - |