Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YouTrack JavaScript Workflow - send email to global group

Tags:

youtrack

I am creating a state machine for YouTrack using JavaScript, and am trying to send an email to everyone in a group. In the old Workflows, this was done like this:

{group:PHP Developers}.notifyAllUsers("Subject","message");

I can't find anything in the new JavaScript API to do this, where can I find the global (not issue or project) groups?

like image 994
Wige Avatar asked Nov 15 '25 05:11

Wige


1 Answers

In JS API it will look as follows:

entities.UserGroup.findByName('PHP Developers') .notifyAllUsers('Subject','message');

However, another (and way more reliable) way to get a particular user group is to add it to requirements and the reference inside the code:

ctx.phpdevs.notifyAllUsers('Subject','message'); ... requirements: { ... phpDevs: { type: entities.UserGroup, name: 'PHP Developers' } }

You may find more details in official documentation: UserGroup and Finding Specific Entities.

like image 105
Mariya Davydova Avatar answered Nov 17 '25 22:11

Mariya Davydova