Java/Groovy for Jira Classes & Packages
Wed Nov 13 2024 20:54:01 GMT+0000 (Coordinated Universal Time)
Jira is written in Java, and uses a collection of Java code to run. The code is made up of classes, which are collections of methods, which are literally the method by which Jira operates. Packages are collections of classes. 1. IMPORTING CLASSES & PACKAGES To do anything with the Component Accessor, we need to import a package or class with which we’d like to work. In this example, we’re going to use a class that allows us to work with projects. In this case, let’s look at the documentation for the ProjectManager class. "Component Accessor" will allow for us to access the functions of the Jira internal libraries. "ProjectManager class" Through the "Component Accessor" will allow us to create an object called "projectManager." At the linked page; where it says Interface ProjectManager, you’ll see that it says com.atlassian.jira.project. That is the package in which the ProjectManager class lives 2. APPLYING YOUR IMPORT: To import any class in the package, add "import com.atlassian.jira.project.*. " Always remember: Related classes are often grouped together in a package Although, ProjectManager isn’t the only class that lives within this package, in the script above it’s the class we’re after.
https://docs.atlassian.com/software/jira/docs/api/9.6.0/com/atlassian/jira/project/ProjectManager.html
Comments