private static Optional < FieldDiffs > copyFieldDiffOfIssueFromOtherBranch ( String issueKey , FieldDiffs c ) { FieldDiffs result = new FieldDiffs ( ) ; result . setIssueKey ( issueKey ) ; result . setUserUuid ( c . userUuid ( ) ) ; result . setCreationDate ( c . creationDate ( ) ) ; // Don't copy "file" changelogs as they refer to file uuids that might later be purged c . diffs ( ) . entrySet ( ) . stream ( ) . filter ( e -> ! e . getKey ( ) . equals ( IssueFieldsSetter . FILE ) ) . forEach ( e -> result . setDiff ( e . getKey ( ) , e . getValue ( ) . oldValue ( ) , e . getValue ( ) . newValue ( ) ) ) ; if ( result . diffs ( ) . isEmpty ( ) ) { return Optional . empty ( ) ; } return Optional . of ( result ) ; }
Copy a diff from another issue