public interface

JiraIssueService

com.atlassian.bitbucket.integration.jira.JiraIssueService

Class Overview

Service used to retrieve and modify Jira issue to commit mappings

Summary

Public Methods
@Nonnull Page<Changeset> getChangesetsForIssue(String issueKey, int maxChanges, PageRequest pageRequest)
Retrieves changesets for commits that are linked to the specified Jira issue.
@Nonnull Set<JiraIssue> getIssuesForCommits(Set<String> commitIds)
Retrieves Jira issues associated with any of the specified commits.
@Nonnull Set<JiraIssue> getIssuesForPullRequest(int repositoryId, long pullRequestId)
Retrieves Jira issues that are associated with the specified pull request.

Public Methods

@Nonnull public Page<Changeset> getChangesetsForIssue (String issueKey, int maxChanges, PageRequest pageRequest)

Retrieves changesets for commits that are linked to the specified Jira issue. This method performs a cross-repository query, but will only return commits in repositories that the user is permitted to see. If a commit exists in multiple repositories, an arbitrary repository is chosen.

For each matching commit that the user is allowed to see, the first maxChanges are retrieved and used to build a Changeset.

Parameters
issueKey the issue key
maxChanges the maximum number of Change changes to return for each changeset
pageRequest specifies the offset and limit for the paging of changesets
Returns
  • a Page of Changeset that are linked to the requested Jira issue, which may be empty but never null

@Nonnull public Set<JiraIssue> getIssuesForCommits (Set<String> commitIds)

Retrieves Jira issues associated with any of the specified commits.

By default, issues are only drawn from the first 100 commits in the provided set. If the set contains more than 100 commit IDs, some issues may not be returned. That limit may be raised by adjusting plugin.jira-integration.pullrequest.attribute.commits.max.

Parameters
commitIds a set of full commit IDs; partial IDs or display IDs will not match
Returns

@Nonnull public Set<JiraIssue> getIssuesForPullRequest (int repositoryId, long pullRequestId)

Retrieves Jira issues that are associated with the specified pull request. Issues are associated with the pull request if they appear in:

  • messages for any of the commits on the pull request
  • the pull request's title
  • the name of the pull request's source branch

By default, issues are only drawn from the first 100 commits on the pull request. If the pull request includes more than 100 commits, some issues may not be returned. That limit may be raised by adjusting plugin.jira-integration.pullrequest.attribute.commits.max.

Parameters
repositoryId the ID of the repository to which the pull request will be merged
pullRequestId the ID of the pull request within the repository
Returns