IssueInput issueToFluentUpdate(Issue issue, com.atlassian.jira.rest.client.api.domain.Issue jiraIssue, Project project) throws NotFoundException {
checkUnsupportedUpdateFields(issue);
IssueInputBuilder inputBuilder = new IssueInputBuilder(jiraIssue.getProject().getKey(), jiraIssue.getIssueType().getId());
issue.getSummary().ifPresent(inputBuilder::setSummary);
inputBuilder.setFieldInput(new FieldInput(IssueFieldId.COMPONENTS_FIELD,
issue.getComponents().stream().map(e -> ComplexIssueInputFieldValue.with("name", e)).collect(Collectors.toList()))
);
issue.getDescription().ifPresent(inputBuilder::setDescription);
issue.getAssignee().ifPresent(assignee -> inputBuilder.setFieldInput(
new FieldInput(IssueFieldId.ASSIGNEE_FIELD, ComplexIssueInputFieldValue.with("name",
assignee.getName().orElseThrow(this::nullUsername)))));
issue.getStage().getStateMap().entrySet()
.stream().filter(entry -> entry.getValue() != FlagStatus.NO_SET)
.forEach(entry -> inputBuilder.setFieldInput(new FieldInput(JSON_CUSTOM_FIELD + FLAG_MAP.get(entry.getKey()), entry.getValue().getSymbol())));
Map<String, Version> versionsMap = StreamSupport.stream(project.getVersions().spliterator(), false)
.collect(Collectors.toMap(Version::getName, Function.identity()));
updateFixVersions(issue, versionsMap, inputBuilder);
updateStreamStatus(issue, jiraIssue, versionsMap, inputBuilder);
return inputBuilder.build();
}