Hello Everyone,
I would like to know, how to identify Xray is enabled for specific jira Project through script runner or Rest API, or any other ways to find it programatically.
Thanks and Regards,
Jyoti
Hi @Jyoti Kumari
A project using Xray is the porject that have the Xray issue type available. You can find them using the following script.
import com.atlassian.jira.component.ComponentAccessordef projectManager = ComponentAccessor.projectManagerdef issueTypeManager = ComponentAccessor.getIssueTypeSchemeManager()// Define the issue type name you want to search fordef targetIssueTypeName = ["Test", "Test Set", "Test Plan", "Test Execution"]// Get all projectsdef allProjects = projectManager.getProjectObjects()List<String> xrayProject = new ArrayList<String>()// Iterate through each projectallProjects.each { project -> // Get issue types for the project def issueTypesForProject = issueTypeManager.getIssueTypesForProject(project) // Check if the target issue type exists in the project if (issueTypesForProject.find { it.name in targetIssueTypeName }) { xrayProject.add(project.key) }}return xrayProject
Regards
Hello @Florian Bonniec
These approach will not work for my scenario, as issue type is showing to the projects in which Xray is disabled, because all these project area is using same Issue type scheme.Kindly guide me ,how these can be achievable.Manually we are able to identify it from Project's setting Action Menu options.
@Jyoti Kumari
Oh you not looking to project that have Xray features but Projects that are configured as Requirement projects with the Xray Requirement Coverage right ?
You want to find project listed in this config page ?
/secure/admin/views/XrayRequirementProjectsConfiguration.jspa
You can use the following endpoint
https://docs.getxray.app/display/XRAY/Integration+with+ScriptRunner#IntegrationwithScriptRunner-Obtainingallprojectswithrequirementcoverageenabled
Hello @Florian Bonniec ,
Thank you so much, it is really helpful.
Best Regards,
It looks like you're new here. Sign in or register to get started.