Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

View issues that have been moved from one project to another

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

 

 

4 answers

2 accepted

3 votes
Answer accepted

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

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 :)

How did you use ScriptRunner to do this? Oh I see a reply below

2 votes
Answer accepted

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.

Thank you - Solved with Script Runner :)

@Kristin Bestla., I have a similar requirement, can you please share the script which worked for you to solve this.

Thanks in advance!!

Hi @Vijay Sv - I used the script from Henning Tietgens from this page:

https://community.atlassian.com/t5/Jira-questions/How-to-find-issues-that-were-moved-from-one-project-to-another/qaq-p/49115

 

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
}

Like # people like this

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.

issue history.JPG

Nice :)

Just commenting on this hoping it becomes something that could be done via JQL one day...

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you