我正在编写一个动作来为用户故事创建默认任务。这是我走了多远:
var workflow = require('@jetbrains/youtrack-scripting-api/workflow');
var entities = require('@jetbrains/youtrack-scripting-api/entities');
exports.rule = entities.Issue.action({
title: 'Create default subtasks',
command: 'tt-create-subtasks',
guard: function(ctx) {
// Condition that must be met to enable the custom command:
return ctx.issue.fields.Type.name == "User Story";
},
action: function(ctx) {
var issue = ctx.issue;
var newIssue = ctx.issue.copy(issue.project);
newIssue.summary = 'API spoofing';
newIssue.fields.Type = ctx.Type.Task;
// var link = newIssue.links.add(issue); ????
workflow.message('Default task created under issue ' && issue.description);
},
requirements: {
Type: {
type: entities.EnumField.fieldType,
Task: {}
},
}
});
如何创建一个新的链接来创建newIssue
一个子任务issue
?
我已经查看了代码完成提供的内容、问题属性的文档、SO 问题、YouTrack 中已经存在的工作流代码,但我被困住了......