We have a Multiple issue types and links are there between each issue types.
Issue types: Bug->Root Cause->CRB/Replacement->Maintenance
Bug issue type will linked with Root cause, Root cause will be linked with Either CRB or Replacement, CRB or Replacement will be linked with Maintenance.
Example: Bug is linked as "is caused by" to Root cause then Root cause "is fixed by" to CRB/Replacement, CRB/Replacement "is implemented by" to Maintenance.
Now i need JQL which gives Bug issue type which have link till Maintenance issue type.
Bug->Root Cause->CRB/Replacement->Maintenance
We are using Script runner Enhanced Search.