Skip to content

Commit

Permalink
Merge pull request #1620 from PublicisSapient/DTS-GS_PlannedWorkStatu…
Browse files Browse the repository at this point in the history
…sFix

Dev Completion Date Fix
  • Loading branch information
aksshriv1 authored Oct 23, 2024
2 parents 42e0bfb + 55d370c commit f6d3aee
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -217,19 +218,19 @@ public void populateIterationDataForDefectWithoutStory(List<IterationKpiModalVal
overAllModalValues.add(iterationKpiModalValue);
}

public String getDevCompletionDate(JiraIssueCustomHistory issueCustomHistory, List<String> fieldMapping) {
public static String getDevCompletionDate(JiraIssueCustomHistory issueCustomHistory, List<String> fieldMapping) {
String devCompleteDate = Constant.DASH;
List<JiraHistoryChangeLog> filterStatusUpdationLog = issueCustomHistory.getStatusUpdationLog();

if (null != fieldMapping && CollectionUtils.isNotEmpty(fieldMapping)) {
devCompleteDate = filterStatusUpdationLog.stream()
.filter(jiraHistoryChangeLog -> fieldMapping.contains(jiraHistoryChangeLog.getChangedTo())
&& jiraHistoryChangeLog.getUpdatedOn() != null)
.findFirst()
.map(jiraHistoryChangeLog -> LocalDate
.parse(jiraHistoryChangeLog.getUpdatedOn().toString().split("T")[0],
DateTimeFormatter.ofPattern(DateUtil.DATE_FORMAT))
.toString())
.orElse(devCompleteDate);
.map(jiraHistoryChangeLog -> LocalDate.parse(
jiraHistoryChangeLog.getUpdatedOn().toString().split("T")[0],
DateTimeFormatter.ofPattern(DateUtil.DATE_FORMAT)))
.max(Comparator.naturalOrder())
.map(LocalDate::toString).orElse(devCompleteDate);
}
return devCompleteDate;
}
Expand Down

0 comments on commit f6d3aee

Please sign in to comment.