Категории добавляются к тегам в проекте 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(
|
||||
issue: 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;
|
||||
}
|
||||
if (!issue.tags || !this.isArray(issue.tags)) {
|
||||
issue.tags = [];
|
||||
}
|
||||
const category = issue.category.name.toLowerCase().replaceAll(' ', '');
|
||||
if (issue.tags.indexOf(category) < 0) {
|
||||
const category = issue?.category?.name?.toLowerCase()?.replaceAll(' ', '_');
|
||||
if (category && issue.tags.indexOf(category) < 0) {
|
||||
issue.tags.push(category);
|
||||
}
|
||||
return issue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue