Skip to content

Commit f70b532

Browse files
committed
update
1 parent 8b20daa commit f70b532

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/lib/Backup/Copy/Traits/CopyIssue.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ public function remapCustomFieldKeys($issue,$idMap){
4949
return [];
5050
}
5151
$map = $idMap;
52-
$custom_fields = $issue->customFields;
53-
$custom_fields = array_filter($custom_fields,fn($c)=>!empty($c->value));
5452
$data = [];
53+
//
54+
$custom_fields = array_filter($issue->customFields,fn($c)=>!empty($c->value));
5555
foreach ( $custom_fields as $idx => $cf ) {
5656
$data[$idx] = [];
5757
$data[$idx]['id'] = $map[$cf->id];
5858
$data[$idx]['value'] =match ($cf->fieldTypeId){
59-
1,2,3,4,8 => $cf->value,
60-
6,7 => array_column($cf->value,'id'),
59+
1,2,3,4,5,8 => $cf->value,// シングル値
60+
6,7 => array_column($cf->value,'id'),//複数値選択
6161
};
6262
if (!empty($cf->other_value)){
6363
$data[$idx]['other_value'] = $cf->value;
@@ -105,7 +105,7 @@ protected function remapIssueKeys( object $issue_api_result, $add_user_name = tr
105105
//"updatedUser",
106106
//"updated",
107107
// TODO parentIssueId をどうするか。
108-
// TODO attachment, customField
108+
// TODO attachment
109109
];
110110
$map_entry = [
111111
"assignee" => fn( $e ) => $e['id'] ?? $e,

src/lib/Backup/Copy/Traits/CopyProject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ protected function copyProjectConf ( $src_project_id, $dst_project_id ) {
5757
'versionIds' => $version_ids,
5858
];
5959
$custom_field_ids = $this->copyProjectCustomField($src_project_id, $this->id_mapping['typeIds'], $dst_project_id);
60-
dump($custom_field_ids);
6160
$this->id_mapping['customFieldIds'] = $custom_field_ids;
6261
return $this->id_mapping;
6362
}
6463

6564
public function copyProject ( $src_project_id, $dst_project_id ) {
6665
$this->copyProjectConf( $src_project_id, $dst_project_id );
66+
$this->copyProjectWikis( $src_project_id, $dst_project_id );
6767
$this->copyIssueList( $src_project_id, $dst_project_id );
6868
}
6969
}

src/lib/Backup/Copy/Traits/CopyProjectCustomField.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ protected function formatCustomField ( object $customField, array $type_ids ) {
4848
$values = array_column($data['items'],'name');
4949
$data['items'] = $values;
5050
}
51+
// カスタムフィールドの必須チェックは誤作動する。
52+
// カスタムフィールド項目が課題作成後に除去されると、以前の課題がNULL値になる。
53+
// そのため除去まえの課題をそのまま投稿するとNULL値が必須チェックに係りエラーになる。
54+
// ひどい仕様なので、必須チェックは無効にする。
55+
$data['required'] = false;
5156
//
5257
return $data;
5358
}

0 commit comments

Comments
 (0)