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

Error with Groovy in ScriptRunner


I am trying to write a script that will talk to the Autotask API and I'm using the Script Console to test on. 

When I run I am hitting this error: Provider for class cannot be created 

and I've tried adding that as an import but it still fails.

Based on some posts online I believe the issue is something to do with the Autotask API messages needing to be in XML but not sure how to get around this.

I'm just doing a very simple call right now to verify the connection will work. 

Here is the test code I've written, this is taken from some sample code I was given and also from their documentation:


import net.autotask.atws.v1_5.ATWS
import net.autotask.atws.v1_5.ATWSResponse
import net.autotask.atws.v1_5.ATWSSoap
import net.autotask.atws.v1_5.ATWSZoneInfo
import net.autotask.atws.v1_5.GetZoneInfo
import net.autotask.atws.v1_5.Ticket
import net.autotask.atws.v1_5.ArrayOfEntity
import net.autotask.atws.v1_5.Entity

def ATWS newser = new ATWS()

ATWSSoap port = newser.getPort(ATWSSoap.class)
BindingProvider prov = (BindingProvider) port

prov.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "userspwd")

def ATWSZoneInfo azi = new ATWSZoneInfo()
azi = port.getZoneInfo("username")

return azi.URL


1 answer

So, I'm having some difficulty finding any information about the AutoTask Java API. I've found a Web Services API, a REST API, but no JavaDoc or anything.

My hunch is that you would need to make sure that a library with the AutoTask API was available on the classpath. I've been unable to find such a library in any maven repositories. Is there a particular plugin you're using to integrate AutoTask with Jira?

I've done that. As you can see by my imports I am referring to a Java version of their API. the error I'm getting appears to be from a conflict with an XML library. 

The Scriptrunner console seems to find their libs fine as I get no errors loading it in the editor whereas I did when it could not find them.

At run time though I get that XML error. 

I understand that. The trouble for me is in reproducing the problem. Where are you _getting_ the AutoTask libs?

The full stack trace would also help me help you.

Certainly. Sorry, I should have thought of that. 

I got it from this link which was provided to me by the company whose Autotask setup we're trying to link up with.

Your right in that it sounds like it's some conflict with an XML library. Similar to this question here.

In that case they excluded the dependency which was causing the issue. If this is a JAR file that's just been provided to you then it's difficult to seework out which dependency is causing the issue.

I see your getting the JAR file from here:

I've unzipped the JAR file and taken a look. It looks like it could be one of the compiled classes that is conflicting. Is there any other API you could use apart from the Java API? The REST API may be easier to use for you. I'd assume this is just a wrapper around that one.

There's a good example here of using the RESTClient already available in ScriptRunner to execute REST calls. There's also further documentation here on that client.

The Java lib was ported over from .Net libs they use. That would be the only other option. 

The issue I'm having is that Autotask's API uses SOAP and expects it's messages in XML. So I was trying to use their libs to construct the required formats. Without their libs I'll have to write all that myself. 

I'm no Java/Groovy expert so I was looking for the easiest route here.

I do know about the Rest Client and have used it a bit before but with Json.  

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...

110 views 6 2
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