Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

imports not working in Script Runner

twinkle.holkar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 22, 2018

Hi

For all my scripts I am getting error on the import statement. Its not related to any specific pkg import. In general scripts are not working in Script Runner because none of the imports are recognised

 

import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
// text field containing tiny url *name*
def textFieldName = "Tiny URL"
def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchService = ComponentAccessor.getComponent(SearchService)
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def commentManager = ComponentAccessor.getCommentManager()
def resolvedIssue = issue
def cf = customFieldManager.getCustomFieldObjectByName(textFieldName)
def tinyUrl = resolvedIssue.getCustomFieldValue(cf)

 

error

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 4: unable to resolve class com.atlassian.jira.web.bean.PagerFilter @ line 4, column 1. import com.atlassian.jira.web.bean.PagerFilter ^ Script1.groovy: 1: unable to resolve class com.atlassian.jira.bc.issue.search.SearchService @ line 1, column 1. import com.atlassian.jira.bc.issue.search.SearchService ^ Script1.groovy: 2: unable to resolve class com.atlassian.jira.component.ComponentAccessor @ line 2, column 1. import com.atlassian.jira.component.ComponentAccessor ^ Script1.groovy: 3: unable to resolve class com.atlassian.jira.jql.parser.JqlQueryParser @ line 3, column 1. import com.atlassian.jira.jql.parser.JqlQueryParser ^

 

Even for other packages I am getting same error

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events