Skip to content

Move a Case to Another Channel

Goal

Transfer the current case to a selected channel while making the treatment of existing activities explicit.

What You Will Learn

  • read a target channel identifier from controlled process data
  • move a case with an audit comment
  • choose whether existing case activities move with the case

Difficulty and Estimated Time

  • Difficulty: Intermediate
  • Estimated time: 20 minutes

Assumed Knowledge

You should be familiar with channels, case-related processes, form data, and postwork scripts.

Required Reading

Prerequisites

  • two case-enabled test channels
  • a related process containing a case-handling task
  • a form field named Transfer/TargetChannelId populated from an approved channel list

Steps

Capture the Destination

Use a channel data source or an administrator-maintained lookup to populate Transfer/TargetChannelId. Do not expose all channels to users who are not allowed to see them.

Move the Case

Add this postwork script to the transfer task:

1
2
3
4
5
6
7
var targetChannelId = $Xml.Evaluate('Transfer/TargetChannelId');

if (!targetChannelId) {
    throw new Error('Select a target channel before transferring the case.');
}

$Case.Move(targetChannelId, 'Transferred by the routing workflow.', false);

The final argument is false, so existing activities remain in their original stream context. Set it to true only when the destination audience is allowed to see the complete activity history.

How It Works

Move resolves the destination channel in the current domain, moves the case, and records the supplied comment. The operation returns the current case instance so additional case operations can be chained when necessary.

Verify the Result

Move a test case and confirm that it appears in the destination channel and no longer appears in the source channel's active case list. Repeat with moveActivities enabled only in a non-production domain and compare the timelines.

Failure and Edge Cases

  • An invalid or inaccessible channel identifier causes the move to fail.
  • Moving activities can disclose history to a different audience.
  • Related processes and channel-specific configuration may differ after the move.

Security and Portability Notes

  • Validate the destination against an allowlist; never trust an arbitrary client-provided channel ID.
  • Confirm that the executing user and destination members are authorized for the case.
  • Resolve channel IDs from current-domain data rather than embedding them in scripts.

What to Learn Next