Creating an Issue from Bitbucket on to Jira Adaptavist Rest Endpoint

Leo Lu December 27, 2021

Hi,

 

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?

Regards,

Leo

1 answer

0 votes
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 27, 2021

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.

Ravi

Leo Lu December 27, 2021

Hi,

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