Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLG_INTG-454 Investigate the reason of stop importing the issue which… #38

Merged
merged 1 commit into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@ class IssueRestClientImpl(httpClient: HttpClient) extends Pageable {
}

def changeLogs(
issueIdOrKey: String
): Either[JiraRestClientError, ChangeLogResult] =
httpClient.get(s"/issue/$issueIdOrKey/changelog") match {
issueIdOrKey: String,
startAt: Long,
maxResults: Long
): Either[JiraRestClientError, ChangeLogResult] = {
val uri = s"/issue/$issueIdOrKey/changelog" ? paginateUri(startAt, maxResults)
httpClient.get(uri.toString) match {
case Right(json) => Right(JsonParser(json).convertTo[ChangeLogResult])
case Left(_: ApiNotFoundError) =>
Right(ChangeLogResult(0, true, Seq.empty[ChangeLog]))
case Left(error) => Left(HttpError(error))
}
}

private[this] def fetchIssue(issueIdOrKey: String) =
httpClient.get(s"/issue/$issueIdOrKey") match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class JiraClientIssueService @Inject() (
maxResults: Long,
changeLogs: Seq[ChangeLog]
): Seq[ChangeLog] =
jira.issueAPI.changeLogs(issue.id.toString) match {
jira.issueAPI.changeLogs(issue.id.toString, startAt, maxResults) match {
case Right(result) =>
val appendedChangeLogs = changeLogs ++ result.values
if (result.hasPage)
Expand Down