Package hudson.plugins.jira
Class JiraSite
- All Implemented Interfaces:
Describable<JiraSite>
You must get instance of this only by using the static
get(hudson.model.Job<?, ?>) or getSitesFromFolders(ItemGroup) methods
The constructors are only used by Jenkins
Represents an external Jira installation and configuration needed to access this Jira.
When adding new fields do not miss to look at readResolve method!!- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionURL of Jira for normal access, likehttp://jira.codehaus.org/.The id of the credentials to use.static final PatternRegexp pattern that identifies Jira issue token.static final Integerstatic final intstatic final intstatic final intDefault rest api client calls timeout, in seconds See issue JENKINS-31113booleanDisable annotating the changelogsGroup visibility to constrain the visibility of the added comment.static final Integerbooleanto record scm changes in jira issueRole visibility to constrain the visibility of the added comment.booleanTrue if this Jira is configured to allow Confluence-style Wiki comment.intconnection timeout used when calling jira rest api, in secondsbooleanupdated jira issue for all statusfinal URLURL of Jira for Jenkins access, likehttp://jira.codehaus.org/.booleanJira requires Bearer Authentication for loginbooleanJira requires HTTP Authentication for login -
Constructor Summary
ConstructorsConstructorDescriptionJiraSite(URL url, URL alternativeUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, boolean supportsWikiStyleComment, boolean recordScmChanges, String userPattern, boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, boolean useHTTPAuth) Deprecated.JiraSite(URL url, URL alternativeUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, boolean supportsWikiStyleComment, boolean recordScmChanges, String userPattern, boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, boolean useHTTPAuth, int timeout, int readTimeout, int threadExecutorNumber) Deprecated.JiraSite(URL url, URL alternativeUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, boolean supportsWikiStyleComment, boolean recordScmChanges, String userPattern, boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, boolean useHTTPAuth, int timeout, int readTimeout, int threadExecutorNumber, boolean useBearerAuth) Deprecated.JiraSite(URL url, URL alternativeUrl, String credentialsId, boolean supportsWikiStyleComment, boolean recordScmChanges, String userPattern, boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, boolean useHTTPAuth) Deprecated.JiraSite(URL url, URL alternativeUrl, String credentialsId, boolean supportsWikiStyleComment, boolean recordScmChanges, String userPattern, boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, boolean useHTTPAuth, int timeout, int readTimeout, int threadExecutorNumber) Deprecated.JiraSite(URL url, URL alternativeUrl, String userName, String password, boolean supportsWikiStyleComment, boolean recordScmChanges, String userPattern, boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, boolean useHTTPAuth) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFixVersionToIssue(String projectKey, String versionName, String query) Adds new fix version to issues matching the jql.voiddestroy()booleanexistsIssue(String id) Deprecated.static JiraSiteGets the effectiveJiraSiteassociated with the given project and creates automatically jiraSession for each jiraSite foundComputes the alternative link URL to the given issue.booleanprotected com.atlassian.httpclient.api.factory.HttpClientOptionsReturns the remote issue with the given id ornullif it wasn't found.getJiraSites(Item item) Creates automatically jiraSession for each jiraSite foundintgetName()getProjectKeys(Item item) Gets the list of project IDs in this Jira.intgetReleaseNotesForFixVersion(String projectKey, String versionName, String filter) Generates release notes for a given version.Deprecated.should not be usedgetSession(Item item) Gets a remote access session to this Jira site (job-aware) Creates one if none exists already.getSitesFromFolders(ItemGroup itemGroup) Creates automatically jiraSession for each jiraSite foundintintgetUrl()Computes the URL to the given issue.Computes the URL to the given issue.Gets the user-defined issue pattern if any.getVersions(String projectKey) Deprecated.booleanbooleanbooleanbooleanbooleanbooleanprotected static com.github.benmanes.caffeine.cache.Cache<String, Optional<com.atlassian.jira.rest.client.api.domain.Issue>> static ItemGroupvoidmigrateIssuesToFixVersion(String projectKey, String versionName, String query) Migrates issues matching the jql query provided to a new fix version.booleanprogressMatchingIssues(String jqlSearch, String workflowActionName, String comment, PrintStream console) Progresses all issues matching the JQL search, using the given workflow action.protected ObjectvoidreplaceFixVersion(String projectKey, String fromVersion, String toVersion, String query) Migrates issues matching the jql query provided to a new fix version.voidsetAlternativeUrl(String alternativeUrl) voidsetAppendChangeTimestamp(boolean appendChangeTimestamp) voidsetCredentialsId(String credentialsId) voidsetDateTimePattern(String dateTimePattern) voidsetDisableChangelogAnnotations(boolean disableChangelogAnnotations) voidsetGroupVisibility(String groupVisibility) voidsetMaxIssuesFromJqlSearch(int maxIssuesFromJqlSearch) voidsetReadTimeout(int readTimeout) Sets read timeout (in seconds).voidsetRecordScmChanges(boolean recordScmChanges) voidsetRoleVisibility(String roleVisibility) voidsetSupportsWikiStyleComment(boolean supportsWikiStyleComment) voidsetThreadExecutorNumber(int threadExecutorNumber) voidsetTimeout(int timeoutSec) Sets connect timeout (in seconds).voidsetUpdateJiraIssueForAllStatus(boolean updateJiraIssueForAllStatus) voidsetUseBearerAuth(boolean useBearerAuth) voidsetUseHTTPAuth(boolean useHTTPAuth) voidsetUserPattern(String userPattern) Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Field Details
-
DEFAULT_ISSUE_PATTERN
Regexp pattern that identifies Jira issue token. If this pattern changes help pages (help-issue-pattern_xy.html) must be updated First char must be a letter, then at least one letter, digit or underscore. See issue JENKINS-729, JENKINS-4092 -
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUTDefault rest api client calls timeout, in seconds See issue JENKINS-31113- See Also:
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUT- See Also:
-
DEFAULT_THREAD_EXECUTOR_NUMBER
public static final int DEFAULT_THREAD_EXECUTOR_NUMBER- See Also:
-
DEFAULT_ISSUES_FROM_JQL
-
MAX_ALLOWED_ISSUES_FROM_JQL
-
url
URL of Jira for Jenkins access, likehttp://jira.codehaus.org/. Mandatory. Normalized to end with '/' -
alternativeUrl
URL of Jira for normal access, likehttp://jira.codehaus.org/. Mandatory. Normalized to end with '/' -
useHTTPAuth
public boolean useHTTPAuthJira requires HTTP Authentication for login -
credentialsId
The id of the credentials to use. Optional. -
useBearerAuth
public boolean useBearerAuthJira requires Bearer Authentication for login -
groupVisibility
Group visibility to constrain the visibility of the added comment. Optional. -
roleVisibility
Role visibility to constrain the visibility of the added comment. Optional. -
supportsWikiStyleComment
public boolean supportsWikiStyleCommentTrue if this Jira is configured to allow Confluence-style Wiki comment. -
recordScmChanges
public boolean recordScmChangesto record scm changes in jira issue- Since:
- 1.21
-
disableChangelogAnnotations
public boolean disableChangelogAnnotationsDisable annotating the changelogs- Since:
- todo
-
updateJiraIssueForAllStatus
public boolean updateJiraIssueForAllStatusupdated jira issue for all status- Since:
- 1.22
-
timeout
public int timeoutconnection timeout used when calling jira rest api, in seconds
-
-
Constructor Details
-
JiraSite
@Deprecated public JiraSite(URL url, @CheckForNull URL alternativeUrl, @CheckForNull String credentialsId, boolean supportsWikiStyleComment, boolean recordScmChanges, @CheckForNull String userPattern, boolean updateJiraIssueForAllStatus, @CheckForNull String groupVisibility, @CheckForNull String roleVisibility, boolean useHTTPAuth) Deprecated. -
JiraSite
@Deprecated public JiraSite(URL url, @CheckForNull URL alternativeUrl, String userName, String password, boolean supportsWikiStyleComment, boolean recordScmChanges, @CheckForNull String userPattern, boolean updateJiraIssueForAllStatus, @CheckForNull String groupVisibility, @CheckForNull String roleVisibility, boolean useHTTPAuth) throws Descriptor.FormException Deprecated.- Throws:
Descriptor.FormException
-
JiraSite
@Deprecated public JiraSite(URL url, URL alternativeUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, boolean supportsWikiStyleComment, boolean recordScmChanges, String userPattern, boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, boolean useHTTPAuth) throws Descriptor.FormException Deprecated.- Throws:
Descriptor.FormException
-
JiraSite
@Deprecated public JiraSite(URL url, URL alternativeUrl, String credentialsId, boolean supportsWikiStyleComment, boolean recordScmChanges, String userPattern, boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, boolean useHTTPAuth, int timeout, int readTimeout, int threadExecutorNumber) Deprecated. -
JiraSite
-
JiraSite
@Deprecated public JiraSite(URL url, URL alternativeUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, boolean supportsWikiStyleComment, boolean recordScmChanges, String userPattern, boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, boolean useHTTPAuth, int timeout, int readTimeout, int threadExecutorNumber) Deprecated. -
JiraSite
@Deprecated public JiraSite(URL url, URL alternativeUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, boolean supportsWikiStyleComment, boolean recordScmChanges, String userPattern, boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, boolean useHTTPAuth, int timeout, int readTimeout, int threadExecutorNumber, boolean useBearerAuth) Deprecated.
-
-
Method Details
-
setDisableChangelogAnnotations
@DataBoundSetter public void setDisableChangelogAnnotations(boolean disableChangelogAnnotations) -
getDisableChangelogAnnotations
public boolean getDisableChangelogAnnotations() -
setTimeout
@DataBoundSetter public void setTimeout(int timeoutSec) Sets connect timeout (in seconds). If not specified, a default timeout will be used.- Parameters:
timeoutSec- Timeout in seconds
-
getTimeout
public int getTimeout() -
setReadTimeout
@DataBoundSetter public void setReadTimeout(int readTimeout) Sets read timeout (in seconds). If not specified, a default timeout will be used.- Parameters:
readTimeout- Timeout in seconds
-
getReadTimeout
public int getReadTimeout() -
getCredentialsId
-
setCredentialsId
-
setDateTimePattern
-
setThreadExecutorNumber
@DataBoundSetter public void setThreadExecutorNumber(int threadExecutorNumber) -
getThreadExecutorNumber
public int getThreadExecutorNumber() -
setAppendChangeTimestamp
@DataBoundSetter public void setAppendChangeTimestamp(boolean appendChangeTimestamp) -
getDateTimePattern
-
isAppendChangeTimestamp
public boolean isAppendChangeTimestamp() -
getAlternativeUrl
-
isUseHTTPAuth
public boolean isUseHTTPAuth() -
isUseBearerAuth
public boolean isUseBearerAuth() -
getGroupVisibility
-
getRoleVisibility
-
isSupportsWikiStyleComment
public boolean isSupportsWikiStyleComment() -
isRecordScmChanges
public boolean isRecordScmChanges() -
isUpdateJiraIssueForAllStatus
public boolean isUpdateJiraIssueForAllStatus() -
setAlternativeUrl
-
setUseHTTPAuth
@DataBoundSetter public void setUseHTTPAuth(boolean useHTTPAuth) -
setUseBearerAuth
@DataBoundSetter public void setUseBearerAuth(boolean useBearerAuth) -
setGroupVisibility
-
setRoleVisibility
-
setSupportsWikiStyleComment
@DataBoundSetter public void setSupportsWikiStyleComment(boolean supportsWikiStyleComment) -
setRecordScmChanges
@DataBoundSetter public void setRecordScmChanges(boolean recordScmChanges) -
setUserPattern
-
setUpdateJiraIssueForAllStatus
@DataBoundSetter public void setUpdateJiraIssueForAllStatus(boolean updateJiraIssueForAllStatus) -
setMaxIssuesFromJqlSearch
@DataBoundSetter public void setMaxIssuesFromJqlSearch(int maxIssuesFromJqlSearch) -
getMaxIssuesFromJqlSearch
public int getMaxIssuesFromJqlSearch() -
readResolve
- Throws:
Descriptor.FormException
-
makeIssueCache
-
getName
-
getSession
Deprecated.should not be used -
getSession
Gets a remote access session to this Jira site (job-aware) Creates one if none exists already.- Returns:
- null if remote access is not supported.
-
getHttpClientOptions
protected com.atlassian.httpclient.api.factory.HttpClientOptions getHttpClientOptions() -
destroy
@PreDestroy public void destroy() -
getUrl
- Returns:
- the server URL
-
getUrl
Computes the URL to the given issue.- Throws:
IOException
-
getUrl
Computes the URL to the given issue.- Throws:
MalformedURLException
-
getAlternativeUrl
Computes the alternative link URL to the given issue.- Throws:
MalformedURLException
-
getUserPattern
Gets the user-defined issue pattern if any.- Returns:
- the pattern or null
-
getIssuePattern
-
getProjectKeys
Gets the list of project IDs in this Jira. This information could be bit old, or it can be null. -
getIssue
Returns the remote issue with the given id ornullif it wasn't found.- Throws:
IOException
-
existsIssue
Deprecated. -
getVersions
Deprecated.Returns all versions for the given project key.- Parameters:
projectKey- Project Key- Returns:
- A set of JiraVersions
-
getReleaseNotesForFixVersion
public String getReleaseNotesForFixVersion(String projectKey, String versionName, String filter) throws TimeoutException Generates release notes for a given version.- Parameters:
projectKey- the project keyversionName- the versionfilter- Additional JQL Filter. Example: status in (Resolved,Closed)- Returns:
- release notes
- Throws:
TimeoutException- if too long
-
replaceFixVersion
public void replaceFixVersion(String projectKey, String fromVersion, String toVersion, String query) throws TimeoutException, com.atlassian.jira.rest.client.api.RestClientException Migrates issues matching the jql query provided to a new fix version.- Parameters:
projectKey- The project keytoVersion- The new fixVersionquery- A JQL Query- Throws:
TimeoutException- if too longcom.atlassian.jira.rest.client.api.RestClientException
-
migrateIssuesToFixVersion
public void migrateIssuesToFixVersion(String projectKey, String versionName, String query) throws TimeoutException Migrates issues matching the jql query provided to a new fix version.- Parameters:
projectKey- The project keyversionName- The new fixVersionquery- A JQL Query- Throws:
TimeoutException- if too long
-
addFixVersionToIssue
public void addFixVersionToIssue(String projectKey, String versionName, String query) throws TimeoutException, com.atlassian.jira.rest.client.api.RestClientException Adds new fix version to issues matching the jql.- Parameters:
projectKey- the project keyversionName- the versionquery- the query- Throws:
TimeoutException- if too longcom.atlassian.jira.rest.client.api.RestClientException
-
progressMatchingIssues
public boolean progressMatchingIssues(String jqlSearch, String workflowActionName, String comment, PrintStream console) throws com.atlassian.jira.rest.client.api.RestClientException Progresses all issues matching the JQL search, using the given workflow action. Optionally adds a comment to the issue(s) at the same time.- Parameters:
jqlSearch- the queryworkflowActionName- the workflowActionNamecomment- the commentconsole- the console- Throws:
com.atlassian.jira.rest.client.api.RestClientException
-
map
-
getJiraSites
Creates automatically jiraSession for each jiraSite found -
getSitesFromFolders
Creates automatically jiraSession for each jiraSite found -
get
Gets the effectiveJiraSiteassociated with the given project and creates automatically jiraSession for each jiraSite found- Returns:
nullif no such was found.
-