The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling the Rest APIS from jira scriptrunner

farhan_shaik97
May 9, 2023

I want to call the external systems(any other App) API from Jira ScriptRunner using a groovy script.

i ran the script but its throwing errors because of these libraries

import groovy.json.JsonOutput
import groovyx.net.http.ContentType
import groovyx.net.http.HttpResponseDecorator
import groovyx.net.http.RESTClient

 

Errors:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 4: unable to resolve class groovyx.net.http.RESTClient @ line 4, column 1. import groovyx.net.http.RESTClient ^ Script1.groovy: 2: unable to resolve class groovyx.net.http.ContentType @ line 2, column 1. import groovyx.net.http.ContentType ^ Script1.groovy: 3: unable to resolve class groovyx.net.http.HttpResponseDecorator @ line 3, column 1. import groovyx.net.http.HttpResponseDecorator

 

can any one help me on how to get this working is there any way we can upload libraries in script runner which are popping this errors.

 

Thank you.

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Aron Gombas _Midori_
Community Champion
May 9, 2023

ScriptRunner have built-in tools for REST API calls, you don't need to rely on the "groovyx" packages.

See: https://docs.adaptavist.com/sr4jc/latest/best-practices/rest-apis

farhan_shaik97
May 9, 2023

Thanks for the quick reply @Aron Gombas _Midori_

But if I want to connect Jira with workday by using the script runner and calling workday from Jira scriptrunner via APIs. How can i achieve this? can u please help me out with this.

 

Thank you

Pavel Kratky
February 29, 2024

Hello, don't know if it is still valid and if you are on Cloud/Datacenter - but this might help you - there are also examples included: REST API FAQs (adaptavist.com)

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events