Handling deactivated users still in a project role

I’m running into an issue where deactivated users, who were in a project role when they were deactivated, are still showing up in that role when the get project role for project API is called to return actors in a project role. This is causing workflow automation (JMWE plugin) problems because these users are getting (trying to get) assigned to issues, which fails because they aren’t active.

According to JMWE, this is a known bug in the API and that’s what I’m seeing to.

My questions is: how can I work around this issue if I want to disable users but pull them out of any project roles they are in before doing so.

At this point, given the various project role APIs, all I can think to do is iterate through every project and every project role in that project, looking for the user I’m disabling and remove them from the project role.

There doesn’t seem to be a way to easily get the set of project roles a user is assigned to.

Am I missing some easier way to handle this?

Thanks.