Class JiraIssueRepository
java.lang.Object
de.qytera.qtaf.xray.repository.jira.JiraIssueRepository
- All Implemented Interfaces:
JiraEndpoint
A class for interacting with Jira issues, such as searching for issues or updating existing issues' fields.
-
Method Summary
Modifier and TypeMethodDescription<R extends ApplicationRoleDto,G extends GroupDto, U extends UserDto<R, G>>
booleanAssigns an issue to a user.static JiraIssueRepositoryRetrieve aJiraIssueRepositoryinstance.getIssueIds(Collection<String> testIssueKeys) Retrieve all issue IDs for the given test issues.getIssueTransitions(String issueIdOrKey) Get a list of the transitions possible for this issue by the current user, along with fields that are required and their types.search(Collection<String> testIssueKeys, AdditionalField... fields) Searches for the given Jira issues, including any additional fields in the response if provided.booleantransitionIssue(String issueIdOrKey, IssueUpdateDto body) Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen.booleantransitionIssue(String issueIdOrKey, String statusName) Performs an issue transition to the provided status.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.qytera.qtaf.xray.repository.jira.JiraEndpoint
getJiraAuthorizationHeaderValue
-
Method Details
-
getInstance
Retrieve aJiraIssueRepositoryinstance.- Returns:
- an instance to work with
-
search
public List<JiraIssueResponseDto> search(Collection<String> testIssueKeys, AdditionalField... fields) throws URISyntaxException, MissingConfigurationValueException Searches for the given Jira issues, including any additional fields in the response if provided.- Parameters:
testIssueKeys- the Jira issues to search forfields- additional fields to include in the response- Returns:
- a list of found issues
- Throws:
URISyntaxException- if any URLs used during search are invalidMissingConfigurationValueException- if the configuration is invalid- See Also:
-
assign
public <R extends ApplicationRoleDto,G extends GroupDto, boolean assignU extends UserDto<R, G>> (String issueIdOrKey, U user) throws URISyntaxException, MissingConfigurationValueException Assigns an issue to a user.- Type Parameters:
R- the role typeG- the group typeU- the user type- Parameters:
issueIdOrKey- the ID or key of the issue to be assigneduser- the user to assign the issue to- Returns:
- true if it was successfully assigned, otherwise false
- Throws:
URISyntaxException- if any URLs used during assignment are invalidMissingConfigurationValueException- if the configuration is invalid- See Also:
-
getIssueIds
public Map<String,String> getIssueIds(Collection<String> testIssueKeys) throws URISyntaxException, MissingConfigurationValueException Retrieve all issue IDs for the given test issues.- Parameters:
testIssueKeys- the test issues to retrieve the IDs for- Returns:
- a mapping of test issue keys to their IDs
- Throws:
URISyntaxException- if any URLs used during retrieval are invalidMissingConfigurationValueException- if the configuration is invalid- See Also:
-
transitionIssue
public boolean transitionIssue(String issueIdOrKey, IssueUpdateDto body) throws MissingConfigurationValueException, URISyntaxException Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen.- Parameters:
issueIdOrKey- the ID or key of the issuebody- the request body- Returns:
- whether the transition was successful
- Throws:
MissingConfigurationValueException- if necessary configuration values are missingURISyntaxException- if the URI for transitioning the issue cannot be constructed- See Also:
-
transitionIssue
public boolean transitionIssue(String issueIdOrKey, String statusName) throws MissingConfigurationValueException, URISyntaxException Performs an issue transition to the provided status.Before the request is made, the issue's possible transitions are queried. The actual follow-up transition request is only made if the possible transitions contain a transition belonging to the provided status.
- Parameters:
issueIdOrKey- the ID or key of the issuestatusName- the target status to transition to- Returns:
- whether the transition was successful
- Throws:
MissingConfigurationValueException- if necessary configuration values are missingURISyntaxException- if the URI for transitioning the issue cannot be constructed- See Also:
-
getIssueTransitions
public List<TransitionDto> getIssueTransitions(String issueIdOrKey) throws MissingConfigurationValueException, URISyntaxException Get a list of the transitions possible for this issue by the current user, along with fields that are required and their types.Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its status, the response will return any empty transitions list.
- Parameters:
issueIdOrKey- the ID or key of the issue- Returns:
- a list of transitions possible for the issue
- Throws:
MissingConfigurationValueException- if necessary configuration values are missingURISyntaxException- if the URI for transitioning the issue cannot be constructed- See Also:
-