Forums

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

Scriptrunner - unable to resolve class

Uday Kiran Raparthy April 18, 2022

I was using the below script to load some data into the Database picker custom field.

I was using an APIGEE API which makes an OAuth call first and then it uses the OAuth Token as the Authentication in the corresponding API call to retrieve data from an application.
Can you recommend any particular library to import?

 

import com.atlassian.jira.component.ComponentAccessor
import org.apache.log4j.Logger
import org.apache.log4j.Level
       
public class ProjectDataInjection
{
def ProjectsData()
    {  
        //Calling UDP API with parameters
        def log = Logger.getLogger("Project API Call")
        log.setLevel(Level.DEBUG)
        def master = new MasterFile()
        String projectURL = master.udpProjects
        String token = new getApigeeToken().getToken()  
        def data = new APICall().getAPICall(projectURL, "Bearer " + token)
        def sort = new sortOptions()
But I got the following error:
unable to resolve class getApigeeToken
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script95.groovy: 19: unable to resolve class getApigeeToken @ line 19, column 24. String token = new getApigeeToken().getToken() 
Can someone please help?

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
April 18, 2022

Hi @Uday Kiran Raparthy what is the API you use (ITSM_Scripts.Data_Injection)? Is there any documentation? Class names convention is really weird here but you definitelly miss getApigeeToken in imports section.

Suggest an answer

Log in or Sign up to answer