I would like to pull a report which consists the task/story/sub-task that is assigned to a sprint and the defect or bug created against the task/story/sub-task and vice-versa i.e. pull a report where a bug is created in the given sprint and it's associated task/story/sub-task.
I'm not sure I fully understand the kind of report you are looking for here. It sounds like you are looking for a report in regards to the related issues to issues within a sprint. I fear that the Sprint report or Epic report won't be able to show you all this information.
I did come across a feature request that seeks to be able to generated a report of linked issues in JRACLOUD-25716. This might not be exactly the same thing you are asking for here, but it mentioned a Link Hierarchy plugin that might help. Perhaps our Marketplace listings have an app that would help arrange this information in a manner that would be helpful here.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event