Hi,
Access to the archieved projects, and loop throug issues. During each loop, list the key or the summary, depending on what you need.
def issues;
def issueManager = ComponentAccessor.getIssueManager();
String Name = "Project = ${ProjectName}";
def jqlSearch = Name;
SearchService searchService = ComponentAccessor.getComponent(SearchService.class)
SearchService.ParseResult parseResult = searchService.parseQuery(user, jqlSearch);
if (parseResult.isValid()) {
def searchResult = searchService.search(user, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())
// Transform issues from DocumentIssueImpl to the "pure" form IssueImpl (some methods don't work with DocumentIssueImps)
issues = searchResult.issues.collect {
issueManager.getIssueObject(it.id)
}
} else {
log.error("Invalid JQL: " + jqlSearch);
}
for(Issue in issues)
{
println Issue.getKey()
}
Something like that, but I would merge this code with yours. ${ProjectName} would be a variable, that you get from your script.
Also inside for loop, you can save Summary, or the key into Array and then list it.
Thanks for the reply. But in my case, project is not archived. Only issue is archived. In that case how can I get?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is a method to do that:
ArchivedIssueSearchService.getArchivedIssuesMatchingTypesInProjects(List<Long> projectIds, List<String> issueTypeIds)
Parameters:
projectIds
- unique identifiers for the projects whose issues we'd like to inspect
issueTypeIds
- unique identifiers for the issue types that we're looking for instances of in the projects.
Returns:
the list of archived issues in the given projects that are of the types specified by issueTypeIds
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. If you don't mind, can you share a sample script plz?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.