Task Assignee
This workflow automatically sets the assignee of an issue when the state changes to In Progress.
Name | @jetbrains/youtrack-workflow-task-assignee |
---|---|
Auto-attached | no |
Modules | Assign issue to current user when state changes to in progress (on-change rule) |
Use Case
This workflow helps you automatically set the assignee of an issue when the state changes to In Progress. This workflow is useful when you work with a agile board. The user who pulls an unassigned issue to start work on it is automatically set as the assignee.
Modules
When the state of an issue is set to In Progress, this rule checks for a value in the Assignee field. If the field is empty, the currently logged-in user is set as the assignee.
Assign issue to current user when state changes to in progress
var entities = require('@jetbrains/youtrack-scripting-api/entities');
var workflow = require('@jetbrains/youtrack-scripting-api/workflow');
exports.rule = entities.Issue.onChange({
title: workflow.i18n('Assign issue to current user when state changes to in progress'),
guard: function(ctx) {
return ctx.issue.fields.becomes(ctx.State, ctx.State.InProgress) && !ctx.issue.fields.Assignee;
},
action: function(ctx) {
ctx.issue.fields.Assignee = ctx.currentUser;
},
requirements: {
State: {
type: entities.State.fieldType,
InProgress: {
name: 'In Progress'
}
},
Assignee: {
type: entities.User.fieldType
}
}
});
Last modified: 16 March 2020