Assign auto generated issue to a specific user

I have set up a workflow that auto generates tickets on a weekly basis but I cant figure out how to assign those tickets to specific users. 

 

I have previously used something like this to assign to the user currently creating the ticket.

ctx.issue.fields.Assignee = ctx.currentUser;

 

But since the system will be creating the workflows this wont work. I need something like this.

ctx.issue.fields.Assignee = User1;

 

 

 

 

0
3 comments
Official comment

Hello,

It is possible to specify your user in the requirement section:

UserOne: {
type: entities.User,
login: 'User1'
}

to get this user in the following manner:

ctx.issue.fields.Assignee = ctx.UserOne;

or, you can find the required user by their login, for example:

ctx.issue.fields.Assignee = entities.User.findByLogin('User1');

Should you have any further questions, feel free to contact us.

Avatar
Permanently deleted user

That worked perfectly. Thank you!

0

You are welcome! 

0

Please sign in to leave a comment.