To stop a repeated message from a case opening a second ticket, save the ServiceNow ticket reference on the Salesforce case once the ticket exists. Before each create request, check whether that reference is already present. If it is, return or update the existing ticket instead. Pair it with a stable request key for retries.
Why a repeated case message opens a second ticket
Duplicates rarely come from one dramatic failure. They usually come from ordinary events that send the same instruction twice. A user saves the case again after changing an unrelated field, and the outbound step runs again. A call times out after the receiving side has already done the work, so the sender retries. A receiving system that does not check for earlier work treats each arrival as new.
An idempotent create step addresses this by design. Running it twice with the same input leaves the system in the same state as running it once. That property has to be built into the integration. Asking people to avoid double-clicking Save does not provide it, because the duplicate usually starts in a background step that the user never sees.
Designing the stored reference
Start by deciding where the link between the two records lives. The common pattern is a dedicated field on the Salesforce case that holds the ServiceNow ticket identifier, with a matching correlation value on the ticket that points back to the case.
- Use the identifier the receiving system returns when the ticket is created. Do not use a display label or a title, because people edit those.
- Give the reference its own field on the case. Free text that people can edit gets edited.
- Write the case record identifier onto the ticket as well, so a ticket found without a case link can still be traced back.
- Leave the field blank when a create fails. A guessed value is worse than an empty one, because the next run will trust whatever it finds.
Building the check that runs before each create
The check is the core of the process. Place it in the first step of the flow, ahead of any create call, and make the outcome of each branch explicit.
- Read the reference field on the case. If it is empty, move to the create step.
- If the field holds a value, look up the ticket by that identifier. If the ticket exists, stop, record the outcome as already linked, and create nothing.
- If the field holds a value but no matching ticket is found, do not create a replacement silently. Flag the case for review. A deleted ticket, a copy of production data, or a mistyped identifier each call for a human decision.
- After a successful create, write the reference back to the case in the same run.
The write-back closes the loop. If the ticket is created and the write-back fails, the next run sees an empty field and creates a second ticket. Treat a failed write-back as a retry of the write, not a retry of the create. Log the create and the write-back as separate steps.
Handling retries, timeouts and duplicate events
Timeouts cause some of the hardest duplicates to diagnose. When the sending side gets no response, it cannot tell whether the request failed or succeeded. Treat an unknown result as possibly successful, and check the reference before you retry. Retrying blindly turns one slow response into two tickets.
- Generate a request key for each intended action. Build it from the case identifier, the action type, and the version or timestamp of the change that triggered it.
- Send the same key with each attempt, and log it beside the outcome.
- Cap the number of retries and space them out, so one timeout does not become a burst of load on both systems. Check the platform limits that apply to your org, and see governor limits for admins.
- Keep create keys and update keys separate, so a repeated update does not look like a new create in the logs.
Keep the key from getting too broad. A key built from the case identifier alone blocks a legitimate second ticket, such as a new problem reported on the same case months later. Including the trigger and the change version keeps intentional new requests moving while still catching repeats.
Access, roles and validation rules around the reference
The reference field is a control point. If many users can edit it, someone can break the link on purpose or by accident, and the next repeat then looks like a new request. Decide who can read and change the field before you build the flow.
- Give the integration user the access it needs to read the case and write the reference, and nothing beyond that.
- Restrict edit rights on the reference field to the integration user and a small admin group.
- Confirm that support users can see the field, because they use it to find the matching ticket.
Group these rights into permission sets rather than editing each profile by hand. Read permission set design for small teams.
Validation rules need the same attention. A rule written for people entering data can block the integration’s write-back, because the write touches the same record. When that happens, the ticket exists but the case holds no reference, and the next run creates a second ticket. After any change to validation rules on the case, test the write-back using the integration user. Review validation rules without breaking integrations before you add a rule to any field that the process writes.
Testing duplicate prevention before go live
Test the flow against the kinds of cases your team actually handles, not a clean sample alone. Run these scenarios in a test environment that fires the same triggers as production.
- Send the same trigger twice in quick succession and confirm that one ticket exists afterward.
- Simulate a timeout after the ticket is created and before the write-back. Confirm that the rerun links to the existing ticket instead of creating another.
- Edit the case in a way that leaves the trigger fields untouched, and confirm that no create runs.
- Clear the reference on a test case whose ticket still exists. Confirm that reconciliation flags the case rather than creating a second ticket.
- Open an intentional new request on a case that already has a linked ticket. Confirm that the flow routes it according to your rules, whether that means an update or a separate ticket.
Test copies are often refreshed from production, and a copied reference can then point at a live ServiceNow ticket. A test run that reads that reference can then act on the live ticket. Add a reset step for the reference field to your refresh routine. For the refresh sequence itself, read sandbox refresh planning, then set the reset step to run as part of it.
For help planning this work, see Salesforce implementation.
Reconciling cases and tickets after go live
A well built flow still needs a regular comparison between the two systems. Run the check on a schedule, weekly for the first month, then monthly once the counts stay quiet.
- Count cases that hold a ticket reference, and compare that number with open tickets that carry a case identifier.
- List cases where the reference is blank but a ticket carries that case identifier.
- List cases whose reference points to a ticket that no longer exists.
Working through a duplicate that already exists
When a duplicate appears, resolve the records first and fix the cause second.
- Identify both tickets and the earlier one. Keep the earlier ticket as the working record unless your support rules say otherwise.
- Check the integration log for the request keys of both creates, and note which attempt wrote the reference.
- Decide whether the write-back failed, the reference was overwritten, or the second attempt skipped the check. Each points to a different fix.
- Close or link the duplicate with a note that names the surviving ticket, so the audit trail reads clearly.
If an edit overwrote the reference, restrict edit access to that field. If the write-back was rejected, review the validation path for the integration user. Do not close the incident until the cause has a fix in place.
What to check on your own instance
How triggers, outbound calls, validation rules and field access behave depends on how your org and the integration user are configured. Confirm each step in this design on your own instance before you rely on the sequence above.
Questions about duplicate handling after go live
Should a repeated trigger update the existing ticket when nothing has changed?
No. If the new payload matches what the ticket already holds, log the event as a no-op and leave the ticket alone. Update the ticket only when a field your process tracks has changed, such as priority or the summary of the customer’s request.
Which identifier should go into the reference field if the receiving system returns more than one value?
Store the value that stays stable for the life of the ticket, and document why you chose it. If reporting needs a second value, keep it in a separate field. A value that someone can rename or reformat will eventually stop matching.
Does the reference prevent duplicates when two different cases describe the same customer problem?
No. The reference only guards against repeats on a single case. Two cases about the same problem are an intake question, and the support process should handle it through its own matching rules rather than through this integration.
What should happen to queued creates when the ServiceNow side is unavailable?
Hold the attempt in a queue with its request key, and show a pending status on the case. When the target recovers, process the queue in order and run the reference check for each item before any create. Do not add a second queued item for the same case while one is pending.