# system.kanoa.shift.getClosestAncestor(assets, shiftBlocks, assetPath, rangeStart, rangeEnd, tzOffsets)

Returns the assetPath that has shifts associated to it in order of the asset path tree. if no shifts are associated, returns None

---
### Parameters
**assets** `List of Dictionaries`: List of assets to search<br />
**shiftBlocks** `List of Dictionaries`: list of shift blocks to search through<br />
**assetPath** `String`: AssetPath we are looking for a shift<br />
**rangeStart** `DateTime`: Start date of range<br />
**rangeEnd** `DateTime`: End date of range<br />
**tzOffsets** `Dictionary`: `{'Pacific Standard Time': {startOffsetMins': -480, 'endOffSetMins': -480}}`<br />

---
### Returns
**assetPath** `String`<br />

---
### Example
```python
assetPath = 'Kanoa Inductries\Adelaide Hills\Packaging\Line 1'
startDate = system.date.parse("2025-01-01 00:00:00")
endDate = system.date.parse("2025-01-07 00:00:00")
assets = system.kanoa.utilities.convertDatasetToDict(system.kanoa.asset.getAssets({}), 'assetPath', None)
tzOffsets = {'Pacific Standard Time': {startOffsetMins': -480, 'endOffSetMins': -480}}
shiftBlocks = system.kanoa.utilities.convertDatasetToJSON(system.kanoa.shift.getShiftBlocks({'recurring': True}))
ancestorPath = system.kanoa.shift.getClosestAncestor(assets, shiftBlocks, assetPath, startDate, endDate, tzOffsets)
```
