Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Sync a Jira Field as a Work Note in ServiceNow: Advanced Use Case

We get a lot of customer requests to integrate Jira and ServiceNow at Exalate. And we come across plenty of interesting use cases in the process. Here is one worth sharing.

The Use Case

A Jira work item is synced with a ServiceNow incident.

There are 2 advanced requirements:

 

image2.png

First Requirement When a comment is added to a synced work item in Jira, it must appear as a Work note (or an internal note) on the ServiceNow side.

Second Requirement If any change is made to a particular field on the Jira work item, that change must be logged as a private Work note on the ServiceNow side.

Note: We are syncing "Summary" from Jira as a Work Note in ServiceNow for this example. But it can be any other field.

Challenges

Syncing summary and description in Jira as a summary and short description in ServiceNow is simple and works out-of-the-box.

But the real challenge lies in two areas:

The summary must be reflected as a short description on the ServiceNow side, the first time the work item is synced over. If any subsequent change is made to this summary, it must be reflected as a work note in ServiceNow instead of updating the short description with the new value. Syncing comments from Jira as internal work notes on ServiceNow also requires a little tweaking.

Why This Use Case Matters

This pattern comes up frequently in incident escalation workflows. Development teams working in Jira often need to pass context back to IT operations in ServiceNow, but not every update warrants changing the core incident record. Work notes keep the audit trail clean while ensuring both sides stay informed.

Common scenarios where this applies include support-to-engineering escalations where internal notes need to flow as work notes, field change tracking for compliance and audit purposes, and cross-team collaboration where only specific updates should be visible in ServiceNow's activity log.

The Integration Solution: Exalate

Exalate works as a bidirectional integration solution for Jira, Jira Service Management, ServiceNow, Azure DevOps Cloud and Server, Salesforce, Zendesk, Freshservice, Freshdesk, Asana, GitHub, and more. You can implement the above use case using the Exalate scripting engine. It is powered by a Groovy scripting engine that allows you to handle complex use cases like this one.

You can configure incoming and outgoing information independently via sync rules present on both sides of the integration. This means each side controls exactly what data it sends and how it processes what it receives.

Exalate also includes Aida, an AI-assisted configuration tool that can help generate and troubleshoot sync scripts, making it faster to implement use cases like this one.

Get Exalate for Jira from the Atlassian Marketplace

How to Set Up a Jira ServiceNow Connection with Exalate

Before implementing the work notes logic, you need a connection between Jira and ServiceNow. Here is how to set it up.

Step 1: Log in to the Exalate app Go to exalate.app and log in. New users can create an account using their email or by signing up with Google.

Step 2: Create a workspace Workspaces help you organize your integrations and connections. Click "+ Create Workspace," enter a name and description, and confirm.

Step 3: Create a connection Click "+ Add connections" > "Create new connection." Enter the system name and URL for your first system (either Jira or ServiceNow). Exalate validates the URL and detects the platform automatically. For ServiceNow, authentication uses Basic credentials. For Jira, it uses OAuth. Repeat for the second system, then give your connection a name and click "Create connection."

Step 4: Choose your configuration path After creating the connection, you have two options:

"Quick Sync" publishes the starter configuration and syncs one item to verify the connection works. This is optional but recommended for initial testing.

"Edit & Test" opens the draft editor where you can modify sync rules before publishing. This is where you will add the work notes logic described below.

Step 5: Understand sync rules Sync rules are Groovy-based scripts divided into outgoing and incoming scripts. The outgoing script controls what data leaves your system, and the incoming script defines how data is mapped on the receiving side. You can use Aida to help generate scripts by describing what you need in plain language, such as "sync comments as internal notes."

For more detail on setting up a Jira ServiceNow integration, check out the full step-by-step Jira ServiceNow integration guide.

Implementation with Exalate

With the connection in place, you can now configure the sync rules.

At the Jira end, the outgoing script decides what information will go out from Jira to ServiceNow, and the incoming script decides what information will be received from ServiceNow. The same applies on the ServiceNow side, only the scripts are reversed.

You can modify these scripts under the sync rules editor. Use the "Edit" button to open the script editor and make changes.

 

image3.png

Note: Triggers are used to automatically start syncing information when certain conditions are met. For example, you can use JQL on the Jira side (like project = SUPPORT AND priority in (High, Highest)) or ServiceNow filter queries to control which work items enter the sync.

The out-of-the-box configuration on the Jira side remains unchanged since there is no additional tweaking required there.

The changes made from the Jira end need to be reflected differently on the ServiceNow side, so we need to modify its incoming script.

Let us see how these requirements will be met one by one.

Implementing the First Requirement

Here, the line that deals with comments on the ServiceNow side is:

entity.comments += replica.addedComments

This line simply syncs the comments from Jira to ServiceNow as-is. We want to modify this behavior. So we commented it out.

And add this line:

issue.comments = commentHelper.mergeComments(issue, replica, {it.internal = true})

We use the mergeComments method of the commentHelper class that Exalate provides to merge the comments on the ServiceNow side. The key part is it.internal=true at the end. This allows the comments from the Jira side to be treated as internal comments (work notes) on the ServiceNow side.

Implementing the Second Requirement

The second part is slightly different. Here, during the firstSync (the first if condition in the code block), we need the summary of the work item to be reflected under a short description in ServiceNow.

So we put entity.short_description = replica.summary under the firstSync condition.

Upon subsequent syncs, we do not want the short description to be updated. So we remove that line from the else block.

To populate the work notes from the Jira summary going forward, we add the code shown below:

if(firstSync){

    //Decide on the first sync, which entity you want to create based on the remote issue type

    entity.tableName = "incident"

    entity.short_description = replica.summary

}

 

if(entity.tableName == "incident") {

//  entity.short_description = replica.summary

    entity.description = replica.description

    entity.attachments += replica.addedAttachments

 

//  entity.comments += replica.addedComments

 

    if(!firstSync && previous?.summary != replica.summary){

        issue.comments = commentHelper.addComment("Summary is now: " + replica.summary, false, issue.comments)

    }

    issue.comments = commentHelper.mergeComments(issue, replica, {it.internal = true})

 

The main object of interest here is previous. It allows us to capture the previous values of the sync. So if the previous summary is different from the current one coming in from Jira, we add the necessary text followed by the actual new summary as a work note.

Testing Before Production

Before publishing your changes, use Exalate's Test Run feature to validate your scripts. Test Run lets you apply the sync configuration to real work items without affecting production data. You can preview the replica and verify that field mappings, including the work note logic, are applied correctly. Only publish when you are confident everything works as expected.

Script versioning also means you can roll back to a previous configuration if something goes wrong after publishing.

Output

We start by creating a work item in Jira and syncing it over to ServiceNow.

Summary, short description, and other required fields have been synced.

 

image1.png

Leave a comment in Jira and see the comment reflected on the other side as a Work note.

Also, change the summary on the Jira work item and see it reflected on the ServiceNow side as a Work note.

[Image: Picture 8.png - original screenshot from the post]

Conclusion

There is a lot you can do with Exalate's scripting engine. The Groovy-based sync rules, combined with helper classes and built-in methods, make it straightforward to implement advanced use cases like routing comments as work notes or tracking field changes.

Features like Aida for AI-assisted scripting, Test Run for safe validation, and script versioning for rollback give you confidence when deploying complex configurations.

Give it a try with a free 30-day trial, or book a demo with our integration engineers to walk through your specific use case.

 

2 comments

Saralie S.
Community Manager
Community Managers are Atlassian Team members who specifically run and moderate Atlassian communities. Feel free to say hello!
August 2, 2022

Hi @francis Just a gentle reminder about our Marketplace Partner Guidelines for article writing. Specifically, "App discussions: Discussions about apps are acceptable in the Marketplace Apps & Integrations collection, and where relevant elsewhere."

Like francis likes this
Taranjeet Singh
Community Champion
August 4, 2022

Thank you @francis for sharing this use casw and its solution.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events