There are some subtasks and their hours need to be tracked. They are not directly related to Sprint work but indirectly related to Sprint. There are not related to particular story so they cannot be added as a subtask of the Userstory. How can Jira be used for this situation.
If it is not in the Sprint, you should not be spending any time on it
If you are following the Scrum process - and it looks like you are - you should not be spending anytime on doing work that is not part of the Sprint. However, if new work is discovered during the Sprint that is needed to accomplish the Sprint Goal, you can add it to the Sprint. Please see the extract from the Scrum Guide below:
"As new work is required, the Development Team adds it to the Sprint Backlog. As work is performed or completed, the estimated remaining work is updated. When elements of the plan are deemed unnecessary, they are removed. Only the Development Team can change its Sprint Backlog during a Sprint. The Sprint Backlog is a highly visible, real-time picture of the work that the Development Team plans to accomplish during the Sprint..."
You can add it as a subtask to one of the stories in the Sprint, even if it is indirectly related to it. If not, and if you are convinced that it is necessary to accomplish the Sprint Goal, add a new story to the Sprint and create a subtask there.
The non-sprint-tasks are recurring activites, or all non-sprint-tasks are of a similar size every sprint. In this case they do not cause changes in your velocity, and therefore they don't need to be logged at all since they just "average out"
The non-sprint tasks are extra work that mean you won't be able to fulfill the amount ow work the team has comitted to for this sprint. In this case there are two options, depending on how critical these tasks are. Either you don't do them until after the sprint is done, or you abort the sprint, perform the tasks and then you start a new sprint planning.