How to Manipulate Custom Hierarchy at the Work Item Level Using the Jira Align APIs
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?