Set assignee (or other field) for an issue created on Agile Board directly

Like setting me as assignee when issue is created in 'My personal board'

Something like workflow for Agile Board

Probably there are some other usecases for setting values of some fields when issue is created directly in Agile Board, depending on it's purpose

But my case is simple - I have a personal Board that shows all issues where I'm set as Assignee. And when I create issue in this board it just disappears if I forget to set myself is assignee

1 comment
Comment actions Permalink

Kirill,

I've replied to you in the direct support request but will post an update here as well. 

This can be achieved with workflows. Workflows are scripts written in JavaScript that extend YouTrack functionality. When you create an issue, an on-change workflow rule can fire and check if this issue belongs to a particular board. If it does, the Assignee field will be automatically set to you.
Inside the workflow, you can access issue boards via ctx.issue.boards. This is a set, so you can iterate through it to review all boards an issue belongs to.
For example, the following code prints to the editor's console names of all boards an issue belongs to:

  ctx.issue.boards.forEach(function(board) {
      console.log("board name: " + board.name);      
    });

Also, here you can find an example of a workflow that assigns an issue to the user who triggered the workflow.

However, please note that if your board has automatic behavior (when issues are added there automatically according to some query), new issues can be added to this board even if you create them not on the board directly. In this case, the rule will fire too and update the Assignee field. That means all issues that belong to your board will have you as an assignee even if they belong to other boards too.

One more workaround that will work only if you don't use swimlanes yet: you can configure swimlanes on the board to divide issues by Assignee. In this case, when you create an issue in a swimlane dedicated to you, it will always have Assignee set to you automatically. I'm attaching a screenshot for your reference:

Please let me know if you have any questions.

0

Please sign in to leave a comment.