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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,276
Community Members
 
Community Events
184
Community Groups

How to list moved jiras from a project to another in Jira cloud

Hi,

I am trying to list all the jiras to an excel that are moved from one project to another. I found recomendations in jira but not on jira cloud.

I have scriptrunner installed and looking for  sample script to list these jiras.

2 answers

1 accepted

1 vote
Answer accepted

I was able to list all moved jiras using the below script on Jira Cloud Script Runner.


// Define a JQL query to search for the issues
def query = '<Query>'

// Fetch the issue object from the key
def searchReq = get("/rest/api/3/search")
.queryString("jql", query)
.queryString("fields","summary")
.queryString("expand","changelog")
.header('Content-Type', 'application/json')
.asObject(Map)


//save the search results
Map searchResult = searchReq.body

searchResult.issues.each { Map issue ->


issue.changelog.histories?.items?.eachWithIndex { it, i ->
def map = it

map.each { entry ->
//logger.info("Entry ${entry.field}")
def level1 = entry
def answer = ''
def from = ''
level1.eachWithIndex { key, value, j ->

if(value == "Key"){
answer = 'Key'

}

if(key == "fromString" && answer == "Key") {
from = "$value"

}
if(value == "${issue.key}" && answer == "Key") {
// This will display the old ticket number and new ticket number
logger.info ("$from moved to $value")
}

}

}

}

}

Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 19, 2020

Great!

Hi Jeevan,

My requirements are exactly same as your :-) - Have you managed to get the results in Excel since 2020?

I am trialing ScriptRunner and quiet novice to its syntax. I have managed to execute your script and getting the Issue Id from Old project to New - which is almost perfect!

I'd like to add more fields to output so that I can manipulate the data in excel. 

  • Issue Created date(before it was moved)
  • Issue Moved Date
  • Resolution Date

 

Any help would be greatly appreciated.

Many thanks

Mitesh 

0 votes
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 19, 2020

Jeevan,

 Unfortunately that is not available yet in script runner for Jira cloud. More information can be found here: https://community.atlassian.com/t5/Jira-Software-questions/Jira-Cloud-Scriptrunner-Find-Issues-that-were-moved-from-other/qaq-p/1267012

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events