How to connect to ScriptRunner REST Endpoint from SR Behaviour without user authentication? Edited

Hi,

I have a REST endpoint that fetches data from an external database. I am using it to convert text field into single select list and that is working like a charm but I also want to use the data provided by that endpoint to populate couple of custom fields. And that is a problem because I don't know how to connect to the endpoint from SR Behaviour.

I tried something simple like HTTPBuilder in the following script:

 

import groovyx.net.http.HTTPBuilder

def builder = new HTTPBuilder('https://myJira.com')
def data = builder.get(path: "/rest/scriptrunner/latest/custom/logistics")
data

 

But it only works if the endpoint isn't restricted to a particular user group and this endpoint must be restricted. I know that I could probably put authentication credentials to HTTPBuilder but it doesn't make sense to me since I am reaching an endpoint in the  same system.

Anyone knows of a way to get to a SR endpoint from groovy script without authentication?

Any suggestions would be very appreciated ;)

Regards,

Bartek

 

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,097 views 4 9
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