Hello :)
I'm using a Java Client to access Jira API.
I've managed to do a search and retrieve all the Epics from a certain project from JIRA and I've noticed that SearchResult.getIssues() returns information as BasicIssue, not Issue. In order to retrieve it as Issue I have to make an extra call.
Is there a way that I could retrieve the information using JQL directly as Issue?
My Code right now:
public List<Issue> readAllEpicsFromProject(String projectKey) {
log.info("call readAllEpicsFromProject");
List<Issue> issues = new ArrayList<>();
NullProgressMonitor pm = new NullProgressMonitor();
SearchResult searchJql = restClient.getSearchClient()
.searchJql("project = \"" + projectKey + "\" AND issueType = epic", pm);
for (BasicIssue issue : searchJql.getIssues()) {
issues.add(restClient.getIssueClient().getIssue(issue.getKey(), pm));
}
return issues;
}
Solved:
I had to migrate from JRJC 1.x to JRJC 2.x.
This is my code now:
public Issue readIssue(String issueKey) {
Promise<Issue> i = restClient.getIssueClient().getIssue(issueKey);
return i.claim();
}
https://ecosystem.atlassian.net/wiki/spaces/JRJC/pages/50593810/Migrating+from+JRJC+1.x+to+2.x
You'd need to look at the docs for your "client" - BasicIssue is something it is doing, and if you want it to do something else, you'll need to use whatever the client API provides.
The REST API will not give you an object though. My best guess is that your client thinks of BasicIssue being the core of an issue, created by asking Jira for the plain text of an issue over REST and built into a more issue-like object from that data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.