Download a list of all workflow, screens and field schemes of all projects

Khaja Mohiuddin February 21, 2022

Hi. We are going through a JIRA migration (on-prem) to cloud. I am trying to get a list of all the associated schemes between all the projects we have in JIRA. Is there a way to download a list of all project names with all associated schemes for Worflows, Screens and Fields?

2 answers

2 accepted

1 vote
Answer accepted
Aditya Sastry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2022

@Khaja Mohiuddin 

This code may suffice your need. Kindly check.

If this works for your, kindly accept the answer.

import com.atlassian.jira.component.ComponentAccessor
import org.apache.log4j.Category
import com.atlassian.jira.project.Project

def issueTypeScreenSchemeManager=ComponentAccessor.getIssueTypeScreenSchemeManager()

def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def Category log = Category.getInstance("com.onresolve.jira.groovy.PostFunction")
log.setLevel(org.apache.log4j.Level.DEBUG)

//gives info about projects
def allProjects = ComponentAccessor.getProjectManager().getProjectObjects()
//Project prj = ComponentAccessor.getProjectManager().getProjectObjByKey("HCI")
def issueTypeSchemeManager = ComponentAccessor.getIssueTypeSchemeManager()
def issueTypeScreenScheme = ComponentAccessor.getIssueTypeScreenSchemeManager()
def wrkflwScheme = ComponentAccessor.getWorkflowSchemeManager()
def fieldScheme = ComponentAccessor.getFieldLayoutManager()


allProjects.each{it->

Project p =ComponentAccessor.getProjectManager().getProjectObj(it.getId())

log.info("Project Name is: " +it.getName())
log.info("Project Id of Long type is: " +it.getId())
log.info ("Issue type Screen scheme is :"+issueTypeScreenSchemeManager.getIssueTypeScreenScheme(p).getName())
log.info("Issue types associated with project is: " +it.getIssueTypes()*.name)
log.info("Workflow Scheme for Project: " +it.getName().toString() +" is: "+wrkflwScheme.getWorkflowSchemeObj(p).getName())
log.info("Screen Scheme is :" +issueTypeScreenScheme.getIssueTypeScreenScheme(p).getName())
log.info("Field Config Scheme is :" +fieldScheme.getFieldConfigurationScheme(p)?.getName())
log.info('---------------------------------------------------------------------')
}

Thanks,

Aditya

Khaja Mohiuddin February 22, 2022

Hi Aditya, thank you so much for your reply. I found out that our projects will be transferred without any issues and this information is not required. I have not tried this solution. But if it worked at your end, I am happy to Accept this answer.

Aditya Sastry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2022

Thanks Khaja. This is a tested solution, so you can accept if you feel like :)

Thanks,

Aditya

Like Pramodh M likes this
Swapan Swaroop September 13, 2024

Hi Aditya,

Can we also include the screens to this? Also I see this code works partially and does not show up all the project data in the logs.

Below is a sample from the output:

Project Name is: Services - Project Zuko 2024-09-13T01:48:41,593 INFO [groovy.PostFunction]: Project Id of Long type is: 31031 2024-09-13T01:48:41,595 INFO [groovy.PostFunction]: Issue type Screen scheme is :SSL: Simple Issue Tracking Issue Type Screen Scheme 2024-09-13T01:48:41,595 INFO [groovy.PostFunction]: Issue types associated with project is: [Epic, Task, Sub-Task] 2024-09-13T01:48:41,596 INFO [groovy.PostFunction]: Workflow Scheme for Project: Services - Project Zuko is: SPZ: Software Simplified Workflow Scheme for 2024-09-13T01:48:41,596 INFO [groovy.PostFunction]: Screen Scheme is :SSL: Simple Issue Tracking Issue Type Screen Scheme 2024-09-13T01:48:41,596 INFO [groovy.PostFunction]: Field Config Scheme is :: Default Field Configuration Scheme

 

Thanks,

Swapan

0 votes
Answer accepted
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 21, 2022

@Khaja Mohiuddin 

Welcome to the Community!!

Use Optimizer for Jira Add-on Trial to download the list, you will get all the reports

https://marketplace.atlassian.com/apps/1217194/optimizer-for-jira?tab=overview&hosting=datacenter

Thanks

Khaja Mohiuddin February 22, 2022

Hi Pramodh, thank you for your reply. I found out that our projects will be transferred without any issues and this information is not required. I did not get a chance to try this solution. Since this is an add-on, I will test this in the future.

Like Pramodh M likes this

Suggest an answer

Log in or Sign up to answer