Hi there
I would like to get an overview of how many issues have been moved from one Project to another Projects, fx. how many issues were actually created within Tech Support / Service desk project but moved to Web Development project or Sales Project etc.
Is this possible somehow?
Best regards
Kristín
By default this is not possible to do via JQL Search. ( Request dear Community members to correct me if I am wrong). Maybe via advanced search using Scriptrunner or directly running the correct query in the database you might be able to achieve the same.
But in the future if you require to search issues moved from one project to another. Create a Custom Field named " Previous Project " and use a workflow transition add-ons (JWME, ScriptRunner etc) to copy the value of Project Name/Key into the this Custom Field via a post function during issue creation.
Now even if the issue is moved, the value of the field remains the same and you can use JQL to search and find moved issues from the previous project name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vijay Sv - I used the script from Henning Tietgens from this page:
Here is the script:
package eventim.scripts
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.web.bean.PagerFilter
jqlQuery = 'project = BBB'
fromProject = 'AAA'
result = ''
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
getFilterResult(jqlQuery,log).each{ Issue issue ->
oldKeys = changeHistoryManager.getPreviousIssueKeys(issue.id)
oldKeys.findAll{it==~/$fromProject.*/}.each{
// result += "$it -> ${issue.key}\n"
result += "$it,${issue.key}<br>"
}
}
return result
List<Issue> getFilterResult(String jqlSearch, log) {
def searchService = ComponentAccessor.getComponent(SearchService.class);
def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
List<Issue> issues = null
def parseResult = searchService.parseQuery(user, jqlSearch);
if (parseResult.isValid()) {
def searchResult = searchService.search(user, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())
issues = searchResult.issues
} else {
log.error("Invalid JQL: " + jqlSearch);
}
return issues
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kristin,
You can't do this out of the box since the WAS and CHANGED operators can be used with the Assignee, Fix Version, Priority, Reporter, Resolution and Status fields only.
If you're on Server, you can do this with JQL Tricks though:
issue in movedIssues("project","Project A","Project B") - Returns all moved issues from "Project A" to "Project B"
(see documentation)
I guess you could also do this with ScriptRunner.
Hope this helps,
- Manon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. I tried out JQL Tricks, looks like they have an error because this query does not work "issue in movedIssues("project", "project A", "project B")". I've written to them but they did not answer.
So, I used script runner to solve this :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How did you use ScriptRunner to do this? Oh I see a reply below
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just commenting on this hoping it becomes something that could be done via JQL one day...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the initial and destination projects use different sets of status' then one can figure what moved from project A to Project B.
E.g. if project A always uses a status = review before the issue is moved to project B, where "review" status is not used, then the following query will find all the issues in project B that have project A pedigree.
project = B and status was in (review)
This will not find issues that were created in Project B (and not moved from Project A).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wasn't aware of the "WAS IN" operator in JQL, that's extremely clever, thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for this answer Abhay - this solved it for me!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cloud Feature Request
https://jira.atlassian.com/browse/JRACLOUD-41039
Server Feature Request
https://jira.atlassian.com/browse/JRASERVER-41039
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it might be doable.
Upon moving an issue, issue key is changed and this information is saved in issue change history.
Now this is certainly searchable by querying the database. I think it can also be searched via Script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you :) I used script runner with a script from here:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nice :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I have figured out a way by which plugin won't be required and it can be performed using built-in functionality of automation (if using cloud).
Here are the steps:
For the above automation, you will be required to have the knowledge of smart values. You can refer to the below document for it.
https://support.atlassian.com/cloud-automation/docs/smart-values-in-jira-automation/
Please let me know if anyone has any question.
Thanks,
Rachit Singhal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are running JIRA Server version. The below JLQ works for me: project = "Project A" AND issue in movedIssues("Project B")
No need for installing Script Runner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The functionality "issue in movedIssues" is not native in Jira
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.