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
// 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)
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
For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...
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