jira-integration: Fix bug if comment length is lower than max length

If the comment length is lower than the max length of the DescriptionField, then
it's not needed to truncate it.

FEA: ItEr77S16JiraAndTimConnectorContributionIntegration
This commit is contained in:
Manuel Rego Casasnovas 2013-01-31 10:26:20 +01:00
parent d736a512ec
commit eea2ace0cc

View file

@ -245,7 +245,11 @@ public class JiraTimesheetSynchronizer implements IJiraTimesheetSynchronizer {
private void updateOrCreateDescriptionValuesAndAddToWorkReportLine(WorkReportLine workReportLine,
String comment) {
DescriptionField descriptionField = workReportType.getLineFields().iterator().next();
comment = comment.substring(0, descriptionField.getLength() - 1);
Integer maxLenght = descriptionField.getLength();
if (comment.length() > maxLenght) {
comment = comment.substring(0, maxLenght - 1);
}
Set<DescriptionValue> descriptionValues = workReportLine
.getDescriptionValues();