Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

imports not working in Script Runner

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
Community showcase
Published in Apps & Integrations

Send an Email or Publish to Confluence - What should you do with your release notes?

Background When you hear the words ‘Release notes’, almost always you think of an unsolicited email from a software vendor. But I am here to tell you that from our data, sending release notes via E...

130 views 1 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