public class JIRAAccessTool extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
JIRAAccessTool.BuildingLambda<B>
Lambda used for building stuff (like tickets or version).
|
Constructor and Description |
---|
JIRAAccessTool(String url,
String user,
String password,
String proxy,
String projectKey,
String jenkinsCredentialsId)
Establishes an connection to JIRA using the given credentials.
|
Modifier and Type | Method and Description |
---|---|
com.atlassian.jira.rest.client.api.domain.BasicIssue |
addTicket(JIRAAccessTool.BuildingLambda<com.atlassian.jira.rest.client.api.domain.input.IssueInputBuilder> buildingFunction,
com.atlassian.jira.rest.client.api.domain.IssueType type)
Publishes a new ticket on JIRA.
|
String |
buildReleaseNotesHTML(List<com.atlassian.jira.rest.client.api.domain.Issue> issuesToShow)
Builds a html page listing all the given Tickets (including links to JIRA).
|
com.atlassian.jira.rest.client.api.domain.Version |
createUpdateVersion(String versionName,
JIRAAccessTool.BuildingLambda<com.atlassian.jira.rest.client.api.domain.input.VersionInputBuilder> buildingLambda)
Marks the given version as released.
|
void |
destroy()
Closes the connection.
|
List<FieldMetadata> |
getAvailableFields()
Receives all available Fields.
|
List<String> |
getAvailableIssuePriorities() |
List<String> |
getAvailableIssueStatuses() |
List<String> |
getAvailableIssueTypes() |
Iterable<com.atlassian.jira.rest.client.api.domain.Transition> |
getAvailableTransitions(com.atlassian.jira.rest.client.api.domain.Issue issue)
Lists all transitions available from the view of the user for the given ticket.
|
List<String> |
getAvailableVersions() |
com.atlassian.jira.rest.client.api.domain.BasicPriority |
getIssuePriorityByName(String priorityName)
Scans for an issue priority on JIRA with the given name.
|
com.atlassian.jira.rest.client.api.domain.IssueType |
getIssueTypeByName(String typeName)
Scans for an issue type on JIRA with the given name.
|
String |
getJenkinsCredentialsId() |
com.atlassian.jira.rest.client.api.domain.Issue |
getTicketByKey(String ticketKey)
Fetches an Issue object using the key of the issue.
|
List<com.atlassian.jira.rest.client.api.domain.Issue> |
getTicketsByJQL(String jqlQuery)
Finds all Tickets matching the given JQL Query.
|
List<com.atlassian.jira.rest.client.api.domain.Issue> |
getTicketsByVersion(com.atlassian.jira.rest.client.api.domain.Version version)
Finds all Tickets which have the given version as their affected version.
|
com.atlassian.jira.rest.client.api.domain.Version |
getVersionByName(String versionName)
Returns a Version-object corresponding the version on JIRA with the given name.
|
void |
performTransition(com.atlassian.jira.rest.client.api.domain.Issue issue,
com.atlassian.jira.rest.client.api.domain.input.TransitionInput transition)
Performs a transition on the given ticket.
|
void |
updateTicket(String ticketKey,
JIRAAccessTool.BuildingLambda<IssueUpdateBuilder> updatingFunction)
Performs an update on the given ticket.
|
public JIRAAccessTool(String url, String user, String password, String proxy, String projectKey, String jenkinsCredentialsId)
url
- the url used for accessuser
- the username used for accesspassword
- the password used for accessproxy
- the proxy to use (can be null)projectKey
- the key of the projectjenkinsCredentialsId
- the id of the jenkins crednetials used for this jirapublic String getJenkinsCredentialsId()
public List<String> getAvailableIssueTypes()
public List<String> getAvailableIssuePriorities()
public List<String> getAvailableIssueStatuses()
public List<String> getAvailableVersions()
public com.atlassian.jira.rest.client.api.domain.Version createUpdateVersion(String versionName, JIRAAccessTool.BuildingLambda<com.atlassian.jira.rest.client.api.domain.input.VersionInputBuilder> buildingLambda)
versionName
- the name of the versionbuildingLambda
- buildingLambda the lambda providing the information about the new versionpublic com.atlassian.jira.rest.client.api.domain.Version getVersionByName(String versionName)
versionName
- the name of the version to look for (e.g. 1.0)public List<com.atlassian.jira.rest.client.api.domain.Issue> getTicketsByVersion(com.atlassian.jira.rest.client.api.domain.Version version)
version
- the version to filter forpublic List<com.atlassian.jira.rest.client.api.domain.Issue> getTicketsByJQL(String jqlQuery)
jqlQuery
- the query to filter forpublic String buildReleaseNotesHTML(List<com.atlassian.jira.rest.client.api.domain.Issue> issuesToShow)
issuesToShow
- the issues to list on the html pagepublic com.atlassian.jira.rest.client.api.domain.BasicIssue addTicket(JIRAAccessTool.BuildingLambda<com.atlassian.jira.rest.client.api.domain.input.IssueInputBuilder> buildingFunction, com.atlassian.jira.rest.client.api.domain.IssueType type)
buildingFunction
- the lambda providing the information of the new ticket.type
- the issue type (e.g. Task, bug, etc)public void updateTicket(String ticketKey, JIRAAccessTool.BuildingLambda<IssueUpdateBuilder> updatingFunction)
ticketKey
- the id of the ticket to updateupdatingFunction
- the lambda for building the updatepublic com.atlassian.jira.rest.client.api.domain.IssueType getIssueTypeByName(String typeName)
typeName
- the name of the type to scan for, e.g. task, bug, etcpublic com.atlassian.jira.rest.client.api.domain.BasicPriority getIssuePriorityByName(String priorityName)
priorityName
- the name of the priority to scan for, e.g. high, medium, etcpublic void destroy()
public com.atlassian.jira.rest.client.api.domain.Issue getTicketByKey(String ticketKey)
ticketKey
- the key of the issue to fetch.public Iterable<com.atlassian.jira.rest.client.api.domain.Transition> getAvailableTransitions(com.atlassian.jira.rest.client.api.domain.Issue issue)
issue
- the issue whose transitions shall be fetched.public void performTransition(com.atlassian.jira.rest.client.api.domain.Issue issue, com.atlassian.jira.rest.client.api.domain.input.TransitionInput transition)
issue
- the issue on which the transition shall be performed.transition
- the transition to be performedpublic List<FieldMetadata> getAvailableFields()
Copyright © 2004-2018. All Rights Reserved.