Forums

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

We need to remove user in bitbucket/stash via Jira script runner

Kalluri_SrinivasaKumar June 12, 2025

Hi Team,

A new user will be added to stash/bitbucket using API and working perfectly. Through Ldap authentication we are using user management, and we need to remove users via Jira script runner.

Thanks in advance for your solution.

1 answer

0 votes
Hari Krishna
Contributor
July 10, 2025

Hi @Kalluri_SrinivasaKumar 

If you're using LDAP authentication with Bitbucket (Stash), user management like creation or removal should be handled directly through the LDAP directory  not via Jira or Bitbucket APIs. These tools treat LDAP users as read-only.

That said, you can still remove or restrict user access using ScriptRunner in Jira by calling Bitbucket’s REST APIs. This can help you:

- Remove users from Bitbucket groups
- Revoke access to specific repositories or projects
- (For local Bitbucket users) disable or delete their accounts

This can all be automated through REST API calls using ScriptRunner's built-in HTTP request support.

However, if the user is LDAP-based, and you want to fully remove their access:

1. Disable or delete the user in the LDAP directory
2. Allow Bitbucket to pick up the change during the next directory sync

That’s the most reliable and recommended approach in LDAP-managed environments.

Suggest an answer

Log in or Sign up to answer