class RetrievalService extends java.lang.Object
Utility class with methods to resolve IDs for various Jira configurations.
The RetrievalService finds this information by querying the Jira REST API.
These utility methods are designed to handle API responses, validate inputs, and throw meaningful exceptions in case of errors.
| Modifiers | Name | Description |
|---|---|---|
class |
RetrievalService.1 |
| Modifiers | Name | Description |
|---|---|---|
static com.fasterxml.jackson.core.type.TypeReference |
COLLECTION_PROJECT_CATEGORY |
| Constructor and description |
|---|
RetrievalService() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static java.lang.Long |
findIssueSecuritySchemeId(java.lang.String schemeName)Finds the ID of an issue security scheme by its name. |
|
static java.lang.Long |
findNotificationSchemeId(java.lang.String schemeName)Finds the ID of a notification scheme by its name. |
|
static java.lang.Long |
findPermissionSchemeId(java.lang.String schemeName)Finds the ID of a permission scheme by its name. |
|
static java.lang.Long |
findProjectCategoryId(java.lang.String projectCategoryName)Finds the ID of a project category by its name. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Finds the ID of an issue security scheme by its name.
This method queries the Jira REST API to retrieve all available issue security schemes and attempts to find the scheme with the specified name. If the scheme is found, its ID is returned. If the scheme cannot be found or if there is an error during the retrieval process, a SchemeRetrievalException is thrown.
Issue security schemes control the visibility of issues in a project by defining who can view issues based on their security level.
Example Usage in Groovy:
def issueSecuritySchemeId = RetrievalService.findIssueSecuritySchemeId("Confidential Issues Scheme")
println "Issue Security Scheme ID: $issueSecuritySchemeId"
schemeName - the name of the issue security scheme to search forFinds the ID of a notification scheme by its name.
This method queries the Jira REST API to retrieve all available notification schemes and attempts to find the scheme with the specified name. If the scheme is found, its ID is returned. If the scheme cannot be found or if there is an error during the retrieval process, a SchemeRetrievalException is thrown.
Notification schemes determine who receives notifications for specific events within a project, such as issue creation, updates, or transitions.
Example Usage in Groovy:
def notificationSchemeId = RetrievalService.findNotificationSchemeId("Default Notification Scheme")
println "Notification Scheme ID: $notificationSchemeId"
schemeName - the name of the notification scheme to search forFinds the ID of a permission scheme by its name.
This method queries the Jira REST API to retrieve all available permission schemes and attempts to find the scheme with the specified name. If the scheme is found, its ID is returned. If the scheme cannot be found or if there is an error while fetching the schemes, a SchemeRetrievalException is thrown.
Permission schemes control access and actions within a Jira project, such as viewing issues, editing issues, or managing project settings.
Example Usage in Groovy:
def permissionSchemeId = RetrievalService.findPermissionSchemeId("Default Permission Scheme")
println "Permission Scheme ID: $permissionSchemeId"
schemeName - the name of the permission scheme to search forFinds the ID of a project category by its name.
This method queries the Jira REST API to retrieve all available project categories and attempts
to find the category with the specified name. If the category is found, its ID is returned as a Long.
If the category cannot be found or if there is an error during the retrieval process, a
ProjectCategoryRetrievalException is thrown.
Project categories are used in Jira to group related projects for better organization and management.
Example Usage in Groovy:
def categoryId = RetrievalService.findProjectCategoryId("Engineering")
println "Project Category ID: $categoryId"
projectCategoryName - the name of the project category to search forLong