Having a sane and stable ID mapping between your data objects and Fragment tasks is important to avoid inconsistencies and to be able to retrieve the task from your existing system.
Requirements
- You have read the API overview guide
- You have read the API integration guide
Fragment task → existing object ID
When you’re creating a task in Fragment that is related to an object in your system, it’s recommended to push information like the object id to Fragment as a custom field. For example if your ticket is coming from Jira, you can push the Jira ticket ID to Fragment as a custom field.task.json
Existing object → Fragment task ID
There are two main options to manage the ID mapping between your existing ticket system and Fragment tasks:1. ID Hash (recommended)
This method doesn’t require you to store the task ID in your system.
123
in your existing system, you can generate a UID like this:
utils.py
If you need to later retrieve the Fragment task from your existing ticket ID, ensure your hashing method is stable and deterministic. The same input should always generate the same UUID. Avoid using timestamps, random values, or other changing data in your hash generation.
2. Store the task ID in your system
This is a good option if you don’t want to generate a UUID for each task or if you want to explicitly store the task ID in your system. First, create the task on Fragment with a/POST
request to the tasks
endpoint.