Категории добавляются к тегам в проекте eccm
This commit is contained in:
parent
e447b381e3
commit
277815d1eb
1 changed files with 3 additions and 3 deletions
|
|
@ -15,14 +15,14 @@ export class CategoryMergeToTagsEnhancer implements IssueEnhancerInterface {
|
||||||
async enhance(
|
async enhance(
|
||||||
issue: RedmineTypes.ExtendedIssue,
|
issue: RedmineTypes.ExtendedIssue,
|
||||||
): Promise<RedmineTypes.ExtendedIssue> {
|
): Promise<RedmineTypes.ExtendedIssue> {
|
||||||
if (this.forProjects.indexOf(issue.project.name) < 0) {
|
if (!issue || !issue?.project?.name || this.forProjects.indexOf(issue.project.name) < 0) {
|
||||||
return issue;
|
return issue;
|
||||||
}
|
}
|
||||||
if (!issue.tags || !this.isArray(issue.tags)) {
|
if (!issue.tags || !this.isArray(issue.tags)) {
|
||||||
issue.tags = [];
|
issue.tags = [];
|
||||||
}
|
}
|
||||||
const category = issue.category.name.toLowerCase().replaceAll(' ', '');
|
const category = issue?.category?.name?.toLowerCase()?.replaceAll(' ', '_');
|
||||||
if (issue.tags.indexOf(category) < 0) {
|
if (category && issue.tags.indexOf(category) < 0) {
|
||||||
issue.tags.push(category);
|
issue.tags.push(category);
|
||||||
}
|
}
|
||||||
return issue;
|
return issue;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue