function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
suji srinivasansuji srinivasan 

Hi, I need to integrate salesforce with jira using REST API post method.

I got JSON response through postman.I am not sure what to be in salesforce rest apex -post method.

I referred this following code
Http http = new Http();
HttpRequest request = new HttpRequest(); request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals');
request.setMethod('POST');
request.setHeader('Content-Type', 'application/json;charset=UTF-8'); // Set the body as a JSON object request.setBody('{"name":"mighty moose"}');
HttpResponse response = http.send(request);
// Parse the JSON response if(response.getStatusCode() != 201) { System.debug('The status code returned was not expected: ' + response.getStatusCode() + ' ' + response.getStatus()); }
else { System.debug(response.getBody()); }

I got error as
Missing return statement required return type: String

Can anyone guide me?Thanks in Advance
VinayVinay (Salesforce Developers) 
Hi Suji,

Can you check below references that can help you.

https://salesforce.stackexchange.com/questions/38541/how-to-integrate-jira-with-salesforce
https://salesforce.stackexchange.com/questions/90212/jira-and-salesforce-integration-example-code-how-to-implement-rest-api-to-cre

Thanks,