Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

ScriptRunner RESTClient Help

I'm trying to call a Zendesk API from a ScriptRunner script listener.   Is this even possible?  Based on what I've found in forums, I've tried the HTTPBuilder and also tried the RESTClient.  Both options fail and are unable to find the "addRequestInterceptor" and "request" methods.  I'm new to this and at a loss.  What am I missing?


import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.protocol.HttpContext;

def RESTClient http;

def baseUrl = "https://{}";
http = new RESTClient(baseUrl);
http.client.addRequestInterceptor(new HttpRequestInterceptor() {
void process(HttpRequest httpRequest, HttpContext httpContext) {
httpRequest.addHeader('Authorization', 'Basic ' + '{user}:{pwd}'.bytes.encodeBase64().toString())

def issue = http.request(POST, JSON) {
uri.path = '/api/v2/tickets/81513.json'


0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

Improving the Create Issue Experience in Jira Service Management Cloud

Hello everyone!  We are very excited to announce some much needed changes to the issue create experience in JSM (the blue "create" button) at the top of the screen.  We have just starte...

274 views 15 7
Read article

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