Gitlab-rails loop through an issue

After migrating a project from one instance to another (as an instance admin), I’m having difficulties with the (not so well documented) rails-console.

I am looping through all issues of a project and I would like to loop through the discussion of each issue to check for “authored_by” (or similar). I.e. at transfer some users where already removed from the project. Their “activity” (comments in issues, etc.) was linked to my account. I want to change that to the support-bot (with its ID).

I am able to loop through the notes, but the notes do not include each issue-comment. How can I accomplish that?