Bitbucket captcha auto unlock

We are looking for a way to auto clear the captcha for a locked out user for our Bitbucket instances.  The end goal is that in our Jira Service Desk a user could submit a ticket through a queue such as "Bitbucket locked".  Then Scriptrunner or other automation would take over, pull the Reporter of the ticket and run an unlock script.  

I've done some research on ways this could be done and put together the following but I need a way for JSD to call this through Scriptrunner or another program and pass over the correct paraments and that's where I'm stuck.  

Has anyone tried anything like this before and been able to get it to work? Or if there's another way to call an unlock please let me know.

 

 

echo 'Username'
read username
echo 'Password'
read -s password # -s flag hides password text
echo 'name'
read -r name

IFS=$IFS=$'\n'

curl -H 'Content-Type: application/json' --user $username:$password -X DELETE https://yourbitbucket.com/rest/api/1.0/admin/users/captcha?name=$name

 

Thanks,

Ray 

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

523 views 3 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you