For Jira Server Real time Synchronization you can create Webhooks in Jira.

Create webhook in Jira for Real-time Synchronization

Since webhooks in jira do not support authorization, it is impossible to perform a callout in SF. To do this, you need to create a community site, and give Guest User access to the Apex class

1.  Create a site

Content Image

Content Image

Click on ‘Get Started’.

Content Image

And enter the Name of the site. Click on ‘Create’.

Click on ‘Activate’.

Content Image

2.Give Guest User access to the peeklogic_jc.JiraServerRestService apex class

Content Image

Click on ‘Public Access Settings’.

Content Image

Go to ‘Apex Class Access’ and enable Apex Class ‘peeklogic_jc.JiraServerRestService’ and ‘peeklogic_jc.JiraServerVersionRestService’

Content Image

3. Generate and paste an API token in the custom settings. (maximum length 128 characters)

You can use the free site https://generate-random.org/api-token-generator?count=1&length=128&type=mixed-numbers&prefix=

the token must contain only numbers and letters. If you want a token with special characters, you need to decode it.

Content Image

Paste in Jira Admin Settings, API token field.

Content Image

Create Named Credentials for callout in Salesforce 

Content Image

and paste their API name in Jira Admin Settings.

Content Image

4. Generate URLs for Jira Webhook

{site-URL}/services/apexrest/peeklogic_jc/JiraServerIssueAPI?issuekey={issue.key}&apitoken={your token saved in custom settings}

4.1 Generate URLs for Jira Webhook Fix versions:

{site-URL}/services/apexrest/peeklogic_jc/JiraServerVersionAPI?versionid={issue.key}&apitoken={your token saved in custom settings}

the red one needs to be replaced with {site-URL}

Content Image

It should turn out like this url

https://peeklogic-jc-dev-ed.my.site.com/mysite/services/apexrest/peeklogic_jc/JiraServerIssueAPI?issuekey={issue.key}&apitoken=jQEshxegys4tG6XyG5XBIsCVDyEP39Ff5XhIC8npyZAjObIdYDvDdJK4lWp2mV4zleNwXoXSZX1aWUfuWUNDRU2f2Rbsnfnk1aQ8JsCBuph0Cy02juV7PdkMOMdi80KV

For fix versions:

https://peeklogic-jc-dev-ed.my.site.com/mysite/services/apexrest/peeklogic_jc/JiraServerVersionAPI?versionid={version.id}&apitoken=jQEshxegys4tG6XyG5XBIsCVDyEP39Ff5XhIC8npyZAjObIdYDvDdJK4lWp2mV4zleNwXoXSZX1aWUfuWUNDRU2f2Rbsnfnk1aQ8JsCBuph0Cy02juV7PdkMOMdi80KV

5. Create a webhook on Jira with the generated URL

 

Paste the URL you generated in the previous step.

Content Image

Content Image

Create a webhook for fix versions on Jira side:

Content Image

 

Content Image

Ready to simplify your Salesforce integrations?

    Peeklogic AI Orchestrator