Salesforce JIRA Synchronous Integration
PURPOSE OF THIS INTEGRATION
Boost your Salesforce CRM business task through smooth integration with Jira
All teams on the same page: Better internal talk=happy customers. coordinated aggregated feedback and connections in both systems.
Coincide your significant data to the other side: Teamwork simplified. Current & error-free updates about Salesforce objects or Jira data.
Bid farewell to manual errors and duplication: Duplicate endeavors and manual data entry is gone. Empower mapping schemes to push or pull data among Jira and Salesforce.
Currently, We have integrated Salesforce with two of the JIRA platforms those are Service platform and Cloud Platform
Steps to create JIRA Cloud Platform account integrating with Salesforce
To Create a Jira Account If You Don't Have One.
B. Verify your account email address.
2. To Convert Your Account URL to .NET for JIRA Cloud API Platform.
When we are done with the signup process of the JIRA platform account. We got an URL like https://id.atlassian.com. So to work with Salesforce JIRA integration we have to convert that URL with .net version(Refer above screenshot with site name field).
As we signed up with a JIRA platform account and they provided us default URL by using this we can’t call REST API.
To call REST API with this platform we use version 3 with username and API token with basic authentication.
To create a JIRA Service account with our custom .com URL like ‘https://jira.concret.com/’ we have to communicate with the Jira support team. To call REST API with this platform we use version 2 with username and password with basic authentication.
B. Fill your details and click Agree and Sign up.
After that please follow the steps as per JIRA standard steps.
3. To Generate an API Token.
A. Click here to generate an API Token and click on Create API token.
B. Fill your API a label
C. A new API Token will be generated, Click View or Copy to Clipboard.
4. To Create A Public Site In Salesforce To Handle JIRA Webhook.
A. Go to Setup, in the Quick Find box, enter “Sites”, click on Sites, then select New.
Fill in the details to create a new Site, then click Save.
Jira Cloud Platform Authentication: To authenticate users by JIRA rest API for Cloud platform We need username and API tokens that we had created in previous steps.
To create JIRA API token for the cloud platform.
Code Example :
Jira Service Platform Authentication:To authenticate users by JIRA rest API for Service platform We need username and password.
NOTE: These above code examples are only to check the JIRA account authentication using REST API’s
About Webhook: A webhook is a user-defined callback over HTTPS. You can use the JIRA webhook to notify your app or web application when certain events occur in JIRA.
To communicate with Salesforce From JIRA we used Webhook.
For More Info Regarding Webhook Please click here
Go to your .NET URL and then navigate to
Jira Settings →System→WebHooks→Create a WebHook
After that we need to click on create a Webhook button once you click below, the screen is visible and we have to fill fields according to our requirement:
URL looks like:
[java]{OrgUrl}/services/apexrest/jira_sfdc?issuekey=${issue.key}&projectkey=${project.key}&modifiedUser${modifiedUser.name}&commentId=${comment.id}&attachmentId=${attachment.id}[/java]
Services/apexrest/jira_sfdc: Is the prefix of request that we made when did activities from JIRA account to salesforce webservice.
Issuekey: This is the key to the issue which automatically populated according to our setting that we did while creating the webhook in JIRA according to activities that we had selected.
Projectkey: This is the key to a project which automatically populated according to our setting that we did while creating a webhook in JIRA according to activities that we had selected.
modifiedUser: Is the id of a user who updated the issue.
CommentId: Is the id of comment which automatically populated according to our setting that we did while creating a webhook in JIRA according to activities that we had selected.
AattachmentId: Is the id of attachment which automatically populated according to our setting that we did while creating a webhook in JIRA according to activities that we had selected.
Restrictions that we faced
We can’t post feeds on chatter using connectedAPI from guest user profiles. That was the restriction that we faced while developing that.
We have a limit of characters to post feed on chatter; it's about 10,000 characters.
We have limitations that we can’t mention users in JIRA description, we can’t attach inline images in the description as well as while posting comments using salesforce with JIRA REST API'S.
We can’t fetch issues and projects according to user permissions from JIRA. To do the same we need administrator permission at Jira end that seems to be not possible for all users.
While implementing auth2.0 authentication with JIRA we can get access token but when we tried to hit API using that we can get status code 200 with a blank body that seems to be an issue at JIRA end. Auth 2.0 Blank body Issue and that seems to be working fine in postman.
References Those We Used While Implementing Whole Functionalities
https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/
https://docs.atlassian.com/software/jira/docs/api/REST/
https://developer.atlassian.com/cloud/jira/software/rest/intro/
https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/
https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-basic-authentication-6291732/
https://community.atlassian.com/t5/Jira-questions/How-to-authenticate-to-Jira-REST-API/qaq-p/814987
Thanks to our Salesforce Consultant Vijay Soni for this amazing blog post brilliantly written with detailed information.