Need list of projects linked to one workflow.
I have checked the Administration -> Workflows -> Open workflow Shows the list of associated workflows -> It also shows hidden projects and i cannot render the list from there
I have also checked for any built in scripts in script runner , but was not a successful
I was not able to find any existing REST API for the same .
Note: My environment doesn't allow installing any new plugins
Please suggest
if you have a scriptrunner, you can execute this piece in console :
import com.atlassian.jira.component.ComponentAccessor
def projectManager = ComponentAccessor.projectManager
def workflowManager = ComponentAccessor.workflowManager
def workflowSchemeManager = ComponentAccessor.workflowSchemeManager
def wfName = "GSEP Template Task Workflow"
def allProjects = projectManager.getProjectObjects()
allProjects.findAll { project ->
def scheme = workflowSchemeManager.getWorkflowScheme(project)
wfName in workflowManager.getWorkflowsFromScheme(scheme)*.name
}*.key
basically goes through all projects and checks if the workflow with such name is in its scheme
change "key" in a last row to "name" if you want list of project names, not keys
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
again, it's not really a error.
the real error won't allow the script to work at all, but it works and returns empty list, which means that either the name of workflow I put there is incorrect and you have to manually edit it or that there is something drastically different between our jiras.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello IIya ,
Thanks i was able to run this script and its working , it seems like there was a extra space in my workflow .
Thanks for all your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ilya ,
I have tried running the Script above , Im getting this as the result , Can you help me out here .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this warning is about using a deprecated method (still works though)
maybe, try copying and pasting the name of you workflow here (since i took it from a screenshot and might have mistyped something):
def wfName = "GSEP Template Task Workflow"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
aight, rewritten it a bit without using deprecated methods
maybe your jira version is newer than mine so for you those just dont work
try this (again, make sure you put proper workflow name in it):
import com.atlassian.jira.component.ComponentAccessor
def projectManager = ComponentAccessor.projectManager
def workflowManager = ComponentAccessor.workflowManager
def workflowSchemeManager = ComponentAccessor.workflowSchemeManager
def wfName = "GSEP Template Task Workflow"
def allSchemes = workflowSchemeManager.assignableSchemes
Set f = []
allSchemes.each {
if (wfName in it.mappings.values()) {
f += workflowSchemeManager.getProjectsUsing(it)
}
}
f*.key
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried that .
When clicked on the Workflow to check the Projects Linked to one workflow so when viewing it shows me that some of them are hidden
Please find the snapshot .
How do i find which are these hidden projects , I have more than 100+ Workflows and 500+ Projects
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jennifer Lobo ,
To know the list of the projects that are using the same workflow: Navigate to the workflow section from the Administration section -> Issues -> click on the view of any workflow -> As shown in the below screenshot you can see a USED BY option at the top which will give you the list of workflows that are using the respective workflow.
Hope this helps you and not require any third-party add-ons.
Regards,
Sravya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How do you see the hidden projects if there are more than 15 using a workflow. If that workflow is being used by several schemes, it's not helpful to look up schemes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.