Answer by Javier Pozuelo on 09 November 2023
Hello Sherine,
To sync the Remote link (Jira ticket link) on your Salesforce case, you need to use the following lines of groovy script:
Jira Outgoing Sync
replica.link = "your instance URL/browse/" + issue.key
Add your instance URL in the replica.link
Salesforce Incoming Sync
entity.labelName = replica.link
You need to replace “labelName” with whichever label you want to use to show the remote link of the Jira Issue.
Comments:
Sherine commented on 10 November 2023
Hi Javier,
Thank you for the reply.
The script mentioned above is working but the issue is whenever the ticket gets created in Jira we have to update a field in Jira to trigger the value and get the link in Salesforce.
In Jira I created a trigger stated below but looks like its not working.
project = PRESALE AND issuetype = “Presales Opportunity” AND status = “New Presales Request”
How to get the value in Salesforce field without updating the Jira ticket?
Thank you
Javier Pozuelo commented on 10 November 2023
Place the following code in the Incoming Sync of your Jira Instance
if(firstSync){
syncHelper.syncBackAfterProcessing()
}
The syncHelper.syncBackAfterProcessing() will trigger this message as it will queue a sync event which is handled as if the issue on external has been changed
If needed, you can read more about syncBackAfterProcessing() on our docs: https://docs.exalate.com/docs/syncbackafterprocessing-42631852
Sherine commented on 10 November 2023
Could you please check if the script is correct? Still its not working
Here is the Salesforce Incoming sync :
if(firstSync){
entity.entityType = “Opportunity”
}
if(entity.entityType == “Opportunity”)
{
entity.Presales_URL__c= replica.link
}
Jira Outgoing Sync:
if(firstSync){
syncHelper.syncBackAfterProcessing()
}
replica.link = “https://devjira-8feb22.pythos.pythian.com/browse/” + issue.key
Javier Pozuelo commented on 13 November 2023
Are you receiving an error or is the link not showing in the label? Have you created the custom label “Presales_URL__c”?
Also, the syncBackAfterProcessing() needs to be in your Jira Incoming Sync instead of the Outgoing.
Sherine commented on 13 November 2023
Hi Javier,
Its working now as expected. Thank you for all your help
Thank you