Code Duplication    Length = 4-7 lines in 2 locations

src/Http/Api/IssueController.php 2 locations

@@ 770-773 (lines=4) @@
767
        {
768
            if (isset($field['required']) && $field['required']) {
769
                if ($mode == 'update') {
770
                    if (isset($data[$field['key']]) && !$data[$field['key']] && $data[$field['key']] !== 0) {
771
                        return false;
772
                    }
773
                }
774
                else 
775
                {
776
                    if (!isset($data[$field['key']]) || !$data[$field['key']] && $data[$field['key']] !== 0) {
@@ 774-780 (lines=7) @@
771
                        return false;
772
                    }
773
                }
774
                else 
775
                {
776
                    if (!isset($data[$field['key']]) || !$data[$field['key']] && $data[$field['key']] !== 0) {
777
                        return false;
778
                    }
779
                }
780
            }
781
        }
782
        return true;
783
    }