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: 

How to determine what to import

Bruce Mohler
Contributor
September 11, 2019

I'm looking at the following lines:

// Retrieve a specific Issue
EventIssueService.IssueResult issueResult = issueService.getIssue(null, issueKey);
MutableIssue mutableIssue = issueResult.getIssue();

which are from an Atlassian Developer page named "Perform Issue Operations" (https://developer.atlassian.com/server/jira/platform/performing-issue-operations/).

When I paste those lines into the Script Console, there are syntax errors.

On the first line, on the variable issueResult, the error is "unable to resolve class EventIssueService.IssueResult.  My first assumption is that I'm missing an import but I do not know how to determine which import file(s) I'm missing.  If I do a Google search on "EventIssueService", the search isn't specific enough to help.  If I search on "jira EventIssueService", no results are returned.

Is the problem that I'm missing an import and how do I determine which files I'm missing?

ty

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Aleksandr Chuiko
September 17, 2019

Hello! 

1) Not 

EventIssueService.IssueResult issueResult = issueService.getIssue(null, issueKey);

But

IssueService.IssueResult issueResult = issueService.getIssue(... 

2) Exact imports can be taken from the documentation https://docs.atlassian.com/software/jira/docs/api/8.4.1 

Search by "issueService" and add in code "import com.atlassian.jira.bc.issue.IssueService" or "import com.atlassian.jira.bc.issue.*"

Снимок экрана 2019-09-18 в 9.16.45.png 

Bruce Mohler
Contributor
September 18, 2019

Thank you, @Aleksandr Chuiko.