Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Creating an Issue from Bitbucket on to Jira Adaptavist Rest Endpoint



I have written groovyscript in adapatavist to create jira issue. It created successfully when I use postman with basic authentication header. However when I try to call the same script via bitbucket webhook I do not know how to pass the authentication to groovyscripy and the jira is refused to create issue. Is there any work around on this?



1 answer

0 votes

Hi @Leo Lu 

Did you create a custom REST Endpoint using ScriptRunner for Jira or were you using Jira's REST API to create an issue?

For ScriptRunner's custom REST end point you have to remove the groups from your script to allow anonymous users to make a REST call.



It’s from Script Runner custom rest endpoint and already removed the group and it allows anonymous. But I am calling this custom rest endpoint from bitbucket webhook and even when I did the script below it still doesn’t allow me to create issue


def userManager = ComponentAccessor.getUserManager()

def createdasuser = userManager.getUserByName("user1")

then I pass this user to create issue but I got error saying I need to logged in to create issue

Suggest an answer

Log in or Sign up to answer

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you