how to set the default assignee when creating a new issue

Hello

Is there a simple way to automatically  set the default assignee when creating a new issue to the person who created the issue? 

In our case, people usually log their own tasks and they will later handle the issues.

Currently when I create a new issue, the default value is "unassigned".
Using a single default assignee (i.e. John Doe) is same as having no default assignee.

thanks in advance!

2 comments
Comment actions Permalink

Hello,

This can be achieved via workflows.

Here is a simple on-change workflow rule that checks that the issue is created and copies the issue reporter to the "Assignee" field:

var entities = require('@jetbrains/youtrack-scripting-api/entities');

exports.rule = entities.Issue.onChange({
title: 'Reporter-assignee',
guard: function(ctx) {
var issue = ctx.issue;
return issue.becomesReported;
},
action: function(ctx) {
var issue = ctx.issue;
issue.fields.Assignee = issue.reporter;
},
requirements: {
Assignee: {
type: entities.User.fieldType
}
}
});
0
Comment actions Permalink

thank you very much! tested and works!

0

Please sign in to leave a comment.