Hi Team,
How we can track the tickets moved from one project to another using JQL query ? Is there any option with Scriptrunner ?
Could you please help me on this.
Hi @jira_admin_cu
You can look into the history of the issues using ScriptRunner. Look for the change in Key.
This page has a script.
Ravi
Hi @Ravi Sagar _Sparxsys_ ,
I put it in Script console and changed the project keys on same code. Did i do anything wrong here ?
Hi Lakshmi_S and Welcome,
Sadly there is not a built-in scripted JQL on Script Runner for Jira to achieve the desired search, you must develop you own as @Ravi Sagar _Sparxsys_ already suggested.
As an alternative you can also use a third-party app to enhance your searching. Using i.e. JQL Booster Pack you can type the following:
Find issues moved from EMEA project to LATAM project , i.e.:
issue IN movedIssues("EMEA", "LATAM")
Note that this is just an exaple, you must tune your query to fit your needs
References:
Hope this helps you to create awesome queries
Kind regards
@jira_admin_cu That is the old script for previous jira versions. For Jira 8, read the comments to the end and you'll get to this:
import com.atlassian.jira.bc.issue.search.SearchServiceimport com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.Issueimport com.atlassian.jira.web.bean.PagerFilterdef jqlQuery = 'project = TEC'def fromProject = 'LCH'def result = ''def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()getFilterResult(jqlQuery).each{ Issue issue ->def oldKeys = changeHistoryManager.getPreviousIssueKeys(issue.id)oldKeys.findAll{it==~/$fromProject.*/}.each{result += "$it -> ${issue.key}<br>"}}return resultList<Issue> getFilterResult(String jqlSearch) {def searchService = ComponentAccessor.getComponent(SearchService.class);def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()List<Issue> issues = nulldef parseResult = searchService.parseQuery(user, jqlSearch);if (parseResult.isValid()) {def searchResult = searchService.search(user, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())issues = searchResult.issues} else {log.warn('Invalid JQL: ' + jqlSearch)}return issues}
It looks like you're new here. Sign in or register to get started.