Kanban
This workflow manages the Kanban state of an issue when it is moved from one stage to the next.
Name | @jetbrains/youtrack-workflow-kanban |
---|---|
Auto-attached | no |
Modules | Block change in Kanban stage for issues that are not ready to pull (on-change rule) |
Use Case
This workflow helps you manage the Kanban state of an issue.
Modules
When a reported issue is moved from one stage to the next, the on-change rule in this module checks the value in the Kanban State field. If the Kanban State is not set to Ready to pull, a warning is displayed. The change is reverted.
If the Kanban State is set to Ready to pull, the Kanban State is set to Blocked when the issue is moved to the next stage.
Block change in Kanban stage for issues that are not ready to pull
var entities = require('@jetbrains/youtrack-scripting-api/entities');
var workflow = require('@jetbrains/youtrack-scripting-api/workflow');
exports.rule = entities.Issue.onChange({
title: workflow.i18n('Block change in Kanban stage for issues that are not ready to pull'),
guard: function(ctx) {
return ctx.issue.isReported && ctx.issue.fields.isChanged(ctx.Stage);
},
action: function(ctx) {
var issue = ctx.issue;
workflow.check(issue.fields.KanbanState.name === ctx.KanbanState.ReadyToPull.name, workflow.i18n('The issue is not ready to be pulled'));
issue.fields.KanbanState = ctx.KanbanState.Blocked;
},
requirements: {
Stage: {
type: entities.State.fieldType
},
KanbanState: {
name: 'Kanban State',
type: entities.EnumField.fieldType,
ReadyToPull: {
name: 'Ready to pull'
},
Blocked: {}
}
}
});
Last modified: 28 October 2020