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 Post method-Rest API

If i create project in salesforce, it should get create in jira 

global with sharing class Jiraproject {

global static void createproject(string Name) {
       
       JSONGenerator gen = JSON.createGenerator(true);

        gen.writeStartObject();
        gen.writeStringField('Name', Name);
        //gen.writeStringField('Id',Id);
        //gen.writeStringField('status__c',status__c);
        gen.writeEndObject();   
    String jsonString = gen.getAsString();
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('url');
request.setMethod('POST');

String username = 'kh@abc.com ';
String password = ' PcuTBIDoQ96784';
       Blob headerValue = Blob.valueOf(username + ':' + password);
    String authorizationHeader = 'Basic ' +
     EncodingUtil.base64Encode(headerValue);
     request.setHeader('Authorization', authorizationHeader);

request.setHeader('Content-Type','application/json;charset=UTF-8');
 // Set the body as a JSON object
 request.setBody (jsonString);

HttpResponse response = http.send(request);

// If the request is successful, 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());
}
    
}
 
}
 can anyone guideme? Thanks in advance
AnkaiahAnkaiah (Salesforce Developers) 
Hi Suji,

Refer the below links will help you to proceed further.
https://dev.to/grushaisergii/how-to-integrate-jira-and-salesforce-342c
https://www.ergonized.com/blog/jira-salesforce-integration/

Thanks!!
Prakhyat sapraPrakhyat sapra
hi suji,

Try this
https://www.ergonized.com/blog/jira-salesforce-integration/