I write down my thoughts so if I get interrupted I can resume from where I was.
Then, I try to encourage people I deal with to use the issue tracker as much as possible.
The only thing worse than keeping JIRA constantly up to date is keeping interrupting managers up to date when I already keep JIRA constantly up to date with the thing they're asking about. It gets amusing when I'm deep down enough into the technical weeds that I've forgotten the exact high level task I'm working on (the thing the manager actually cares about), and refer to JIRA myself to answer the question of what I'm working on.
"Hey, how is this task going?" -> go to JIRA
"Hey, are you blocked?" -> go to JIRA
"Who is working on this?" -> go to JIRA
Then I check JIRA when I have the time.