Ошибка при обновлении поля после применения workflow
Пытаюсь решить задачу через workflow Javascript editor: При изменении поля "Release Date" (date) в задаче, во всех связанных задачах данное поле так же должно обновляться.
Ниже скрипт:
const entities = require('@jetbrains/youtrack-scripting-api/entities');
exports.rule = entities.Issue.onChange({
title: 'Update Release Date in All Related Issues',
guard: (ctx) => {
// Проверяем, изменяется ли поле Release date
return ctx.issue.isChanged(ctx.release_date);
},
action: (ctx) => {
const issue = ctx.issue;
const newrelease_date = issue[ctx.release_date]; // Получаем новое значение даты релиза
// Обновляем Release date у всех связанных задач
issue.links.forEach((link) => {
link.to.forEach((relatedIssue) => {
relatedIssue[ctx.release_date] = newrelease_date;
relatedIssue.execute();
});
});
},
requirements: {
release_date: {
type: entities.Field.dateType,
name: 'Release date'
}
}
});
В проекте создано кастомное поле “Release date” с alias = release_date. При попытке обновить данное поле в задаче получаю ошибку: “Couldn't update issue field. The rule threw an exception when processing the following issue: 70-528894”.
Please sign in to leave a comment.
Hello,
I'm Lena from the YouTrack Team. Thank you for reaching out.
I'm afraid the primary language of the support communication is English, so I have to ask you to switch to English. I appreciate your understanding.
As for the issue, could you please text us directly using this link: https://jb.gg/ytsup ? We need some additional information and it might be sensitive.
Thank you.