For the complete documentation index, see llms.txt. This page is also available as Markdown.

Items Routing Scripting

Item Routing scripting lets you decide where Getint creates each synced item. The script reads the item that triggered the sync and returns the project and item type for its counterpart on the other side. Use it when items from one project need to land in different projects or item types based on their field values, such as the assignee.

Item Routing scripts use JavaScript (JS) syntax. Getint runs the script before the item syncs because it must know the destination first.

How to Access the Items Routing Code Editor

  1. From your integration editor, click Items Routing.

  1. The Items Routing panel opens with the visual route builder. Click Switch To Code Editor at the top of the panel.

  1. Enter your script and click Apply.

How Item Routing Works

Each Item Routing script belongs to one side of the integration and decides where that side creates items. The trigger object always comes from the opposite side.

For example, if you set Item Routing for the LEFT app:

  1. state.triggerObj holds the item from the RIGHT app.

  2. The script returns a projectId and issueTypeName that exist in the LEFT app.

Required Return Value

The script must return an object with two non-empty properties:

  • projectId: the ID of the target project.

  • issueTypeName: the name of the target item type.

return {"projectId": "10778", "issueTypeName": "Task"}

If either property is missing or empty, Getint can't route the item, and it won't sync correctly.

Available Commands

State

API

Example: Route Jira Issues by Assignee

This script routes Jira issues to different projects based on the assignee's display name. Issues assigned to a user whose name contains "Marcin" go to project 10778, and issues assigned to a user whose name contains "Service" go to project 11405. Both are created as Tasks.

Checking Script Logs

Messages written with api.log appear in the Run logs. Getint resolves Item Routing before the sync starts, so the output belongs to the run rather than to an individual item sync.

If you encounter any issues or need further assistance, contact our support team here.

Last updated

Was this helpful?