You need to sign in to do that
Don't have an account?
Santhosh Reddy 54
How to call rest apex public class from outside like jira webhook
Hi Mates,
I need a help on integrating salesforce to jira and viceversa without any plugin/addon/third party tools in developer edition
i was trying to push case from salesforce to jira as issue, and it is done using Callout working fine
But also need to push issue from jira to salesforce as case for this i created a webhook and created apex rest api class in salesforce and made that class as public from site, see below class
@RestResource(urlMapping='/JiraToSFRestTest/*')
global class JiraTOSFRestTestController {
@HttpPost
global static String doPost(String issueId,String issueKey, String projectId, String projectKey) {
Case CaseObj = new Case();
CaseObj.Status = 'Working';
CaseObj.Origin = 'Web';
CaseObj.Subject = issueId+'->'+issueKey;
CaseObj.Description = projectId+'->'+projectKey;
insert CaseObj;
return CaseObj.Id;
}
}
webhook url look like this
https://SaleforceSiteURL/services/apexrest/JiraToSFRestTest?issueId=${issue.id}&issueKey=${issue.key}&projectId=${project.id}&projectKey=${project.key}
I am executing this rest class from workbench then it is working fine but how to call this rest api class directly without login into salesforce from jira webhook
Don't know how to impletement can any one help on this with step by step preocedure please
Awaiting your responce
I need a help on integrating salesforce to jira and viceversa without any plugin/addon/third party tools in developer edition
i was trying to push case from salesforce to jira as issue, and it is done using Callout working fine
But also need to push issue from jira to salesforce as case for this i created a webhook and created apex rest api class in salesforce and made that class as public from site, see below class
@RestResource(urlMapping='/JiraToSFRestTest/*')
global class JiraTOSFRestTestController {
@HttpPost
global static String doPost(String issueId,String issueKey, String projectId, String projectKey) {
Case CaseObj = new Case();
CaseObj.Status = 'Working';
CaseObj.Origin = 'Web';
CaseObj.Subject = issueId+'->'+issueKey;
CaseObj.Description = projectId+'->'+projectKey;
insert CaseObj;
return CaseObj.Id;
}
}
webhook url look like this
https://SaleforceSiteURL/services/apexrest/JiraToSFRestTest?issueId=${issue.id}&issueKey=${issue.key}&projectId=${project.id}&projectKey=${project.key}
I am executing this rest class from workbench then it is working fine but how to call this rest api class directly without login into salesforce from jira webhook
Don't know how to impletement can any one help on this with step by step preocedure please
Awaiting your responce
What have you done is looks fine for jira to salesforce integration.
I didn't get this line of you " but how to call this rest api class directly without login into salesforce from jira webhook" .... For this only you have created public site.
Thanks,
Govindaraj.S
Refer this links
http://www.wadewegner.com/2013/03/creating-anonymous-rest-apis-with-salesforce-com/
Did u give access to the 'Apex class' & 'Case object' in 'Public AccessSettings' ?
Thanks,
Govindaraj.S
Do you have any namespace in your org?
I am able to call REST API from JIRA Webhook using this url : https://complete-site-url/services/apexrest/hii//webhook/V1.
Thanks
We are having the same issue while posting could you please let me know what was the resolution you did to achive this. If possible please share the code.
pease have a look at few code examples below,
taken from the blog "7 Ways to Integrate Salesforce and Jira (https://www.peeklogic.com/article/7-ways-to-integrate-salesforce-and-jira/)"
Create Jira Issue from Salesforce CRM:
Get Jira issue details with Apex
Add comment to Jira Issue in Salesforce CRM