Syncing from Zendesk to Jira Cloud, I want to set up some conditions in case of which no Jira ticket is created but the Zendesk ticket is updated to note that the Jira ticket creation was not possible. For that I would include the followoing in the Jira incoming script : (modification of the replica, syncing back after processing and stoping the current synchronization)
I have bidirectional connection (there are incoming and outgoing scripts on both directions), but I experience that even if the Jira incoming script is running into this condition, the Zendesk incoming script is not started.
Am I understanding the documentation of syncBackAfterProcessing right, that the Zendesk incoming script should be started even if there is no Jira ticket pair of the Zendesk ticket?
If not, how can I achieve to notify the Zendesk agents if the Jira incoming script is running to a “return” (no Jira ticket is created due to insufficient info)?
You’re on the right track with using syncHelper.syncBackAfterProcessing(), but there’s an important detail in how it works: according to the documentation, syncBackAfterProcessing() triggers a sync event back to the source (Zendesk in your case) only after the destination (Jira) has processed the incoming sync. However, this mechanism assumes that a destination issue (Jira ticket) was actually created and exists as a pair for the source issue.
If your Jira incoming script returns before creating a Jira issue (i.e., no issue is created), there is no Jira-Zendesk issue pair established. As a result, the syncBackAfterProcessing() call does not trigger the Zendesk incoming script, because there’s no destination issue to anchor the sync event. This is a limitation of how Exalate’s sync pairing works.
So, to answer your question: No, the Zendesk incoming script will not be triggered if the Jira issue is not created, even if you call syncBackAfterProcessing(). The documentation confirms that the sync event is processed as if the destination issue has changed, but if the destination issue does not exist, there’s nothing to trigger the sync back.
If you want to notify Zendesk agents when a Jira ticket is not created, you’ll need to handle this outside of the standard Exalate sync flow. Some options:
Use a custom field or comment in Zendesk and update it directly from the outgoing script (before the sync is attempted), or
Use an automation or webhook in Zendesk to detect when a sync attempt fails or when a specific custom field is set.
For more details, see the documentation:
In summary: syncBackAfterProcessing() only works when a destination issue exists. For your use case, you’ll need a workaround outside the standard sync-back mechanism to notify Zendesk when Jira ticket creation is skipped.
How to update the Zendesk issue directly from the outgoing script? If I put the following in the Zendesk outgoing script, it runs into the condition, but no comment is created on the issue.
def createIssueComments = issue.comments.findAll { comment -> comment.body.contains("[JIRA Summary]") }
if(createIssueComments.size() == 0){
issue.comments = commentHelper.addComment("Please fill in the JIRA summary", issue.comments)
return;
}
Hiya, I also have built Zendesk to Jira cloud, just wanted to confirm a couple of things.
How is the ticket being connected, do you have some custom triggers to allow the connection.
Are you wanting Jira to loop back confirming that Jira was not created.
Are you wanting some Zendesk notes kept isolated to Jira.
Can you provide an ideal scenario what you are trying to achieve, I may have some tips and tricks that may be able to help between the classic scripts from incoming and outgoing both for Zendesk and Jira.
There is an Exalate trigger on Zendesk side: when a certain tag is added to the Zendesk ticket and the status is On-hold, then the sync starts.
Usually it creates a Jira ticket through the Zendesk outgoing and Jira incoming scripts.
But now I want to implement that if there is no comment on the Zendesk ticket with a specific text (“[JIRA Summary]”), then no Jira ticket should be created, but instead a comment should be added to the Zendesk ticket about the missing text. For that, I tried to add a comment to the Zendesk issue in the Zendesk outgoing script: so instead of giving data to the replica, I wanted to modify the issue which was the starting point of the whole sync. (See in my previous comment to this topic). But I don’t know whether it is possible to do so.
There might be a way, personally I would try this in the Zendesk outgoing scripts telling it that if no comment in Zendesk, then loop back, you may need to push a script on the incoming back to zendesk but here is a funky script you could try using in the outgoing Zendesk you can try, I hope this is something you are looking for?
issue.comments = commentHelper.addComment("There is no information to proceed, please enter summary.", false, issue.comments)
// Stop further processing to prevent ticket creation in Jira
throw new com.exalate.basic.domain.exception.IssueTrackerException("No summary and no comments present. Not creating Jira issue.")