How to Manipulate Custom Hierarchy at the Work Item Level Using the Jira Align APIs
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Jira Align supports custom rooms with custom hierarchy levels that can be assigned to work items. It is possible to assign or unassign the work items to these custom levels using the API. The API endpoints used for manipulating the assignments at the work item level are Domains and DomainItemRelation. A common point of confusion is that the CustomHierarchy endpoints are used for this, but that is not the case.
Environment
Jira Align
Solution
Doing a GET on the Domains endpoint will return a list of the levels and IDs that you have created in your custom rooms. You can then use these IDs to associate individual work items to the desired hierarchy level using the DomainItemRelation endpoint.

Sample
Adding the Custom Hierarchy with ID 237 to Epic with ID 9224:
POST URL/rest/align/api/2/Domains/237/relations
{
"objectType": 2,
"objectId": 9224
}
Response:
{
"id": 346,
"objectType": 2,
"objectId": 9224,
"self": "URL/rest/align/api/2/domains/237/relations/346"
}
Was this helpful?