Thanks @martins.vanags !
I tried this solution.
The only thing that I am missing is that using this solution - I can’t see the bugs… The bugs are located in different project(s) and using this method only issues from the same project of the epic can be seen.
in my use case - the custom fields are text fields
Make sure the bugs from other projects are imported from the import options page.
The hierarchy won’t show unimported issues.
The approach should work find with single-line text fields.
The JS code would be slightly different (because JSON structure for text fields is different), but it should work with text fields.