Dear All,
I am writing a script to display all the issues which are of "Story" issue type in a given project "ABC" but my script is listing all the issues in a project but not getting the list based on the requested issue type.
Below is the script to get the list of issues in given project.
Method-1:
*************
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.config.manager.IssueTypeSchemeManager
import com.atlassian.jira.project.Project
IssueTypeSchemeManager issueTypeSchemeManager = ComponentAccessor.getIssueTypeSchemeManager()
//issueTypeSchemeManager.getAllSchemes()*.name.
Project project = ComponentAccessor.getProjectManager().getProjectByCurrentKey("ABC")
def issueTypeMgr = ComponentAccessor.getIssueManager()
def availissuetypeslist = issueTypeSchemeManager.getIssueTypesForProject(project)*.name
def issuetype = "Story"
long count = issueTypeMgr.getIssueCountForProject (project.id)
if (issuetype in availissuetypeslist)
{ def issue = issueTypeMgr.getIssueObjects(issueTypeMgr.getIssueIdsForProject(project.id))
}
Method-2:
***************
import org.ofbiz.core.entity.GenericValue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.project.Project
import com.atlassian.jira.project.ProjectManager
def ret=[]
ProjectManager projectManager = ComponentAccessor.getProjectManager()
Project proj= projectManager.getProjectByCurrentKey("ABC")
IssueManager issueManager = ComponentAccessor.getIssueManager()
for (GenericValue issueValue: issueManager.getProjectIssues(proj.genericValue))
{
Issue issue = issueManager.getIssueObject(issueValue.id)
ret.add issue
}
return ret
In both the methods i am getting all the issues in the project ABC and tried all the combinations in the script runner server version (7.6) version but no result.
we are running the 8.13.9 server version of Jira and really looking forward the help to display the list of issues based on the required issue type from "ABC" Jira project.
Thanks and Regards,
Ramesh