Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Remove inactive users from project roles

Filip Labarque
Contributor
December 6, 2018

I'm trying to create a script that removes inactive users from a project role.

First I run an SQL query that gives me the inactive users still in a role. Then I try to execute this function for each entry in the SQL result:

projectRoleService.removeAllRoleActorsByNameAndType (it.user_name, it.NAME, errorCollection) 

But I get the following error for each entry:

WARN [ofbiz.ConnectionPoolHealthSqlInterceptor]: Dangerous use of multiple connections: taken => count=2; marks=[1-0]; pool=29/20
WARN [ofbiz.ConnectionPoolHealthSqlInterceptor]: Dangerous use of multiple connections: replaced => count=1; marks=[0-0]; pool=28/20

 

Does anyone have an idea on how to avoid this issue?

1 answer

0 votes
Dave Theodore [Coyote Creek Consulting]
Community Champion
December 6, 2018

I would not recommend manually modifying the database. Unless you have a really good understanding of the schema, you're asking for trouble. This is also not a supported modification.

It's easy to do this sort of thing using the Jira CLI.  Check the examples page in their docs and search for "role" on the page to see example syntax.

Filip Labarque
Contributor
December 7, 2018

I'm not manually modifying the database. I just use an SQL statement to get a list of inactive users in a role. The modification is done through the API:

projectRoleService.removeAllRoleActorsByNameAndType (it.user_name, it.NAME, errorCollection) 

Suggest an answer

Log in or Sign up to answer