【发布时间】:2018-02-07 22:53:01
【问题描述】:
我有一个适用于 YouTrack 的 JavaScript 工作流,当一个问题设置为打开时,应该将几个字段重置为“null”。这是我用来完成此操作的代码:
Open: {
onEnter: function (ctx, issue) {
issue.fields['Alpha Approved By'] = null; // <- This is where the error points
issue.fields['UAT Approved By'] = null;
issue.fields['QA Approved By'] = null;
issue.fields['PM Approved By'] = null;
},
transitions: {
Working: {
targetState: 'In Progress'
},
Rejected: {
targetState: 'Rejected'
}
}
},
但是,每当我尝试创建问题时,都会收到以下错误消息:
TypeError: Cannot read property "fields" from undefined (workflow-enforcement/workflow-enforcement#20)
第20行在代码sn-p中标注了注释
我应该如何设置这些字段的值?
【问题讨论】:
标签: youtrack