3

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?

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
Wige
  • 3,788
  • 8
  • 37
  • 58

1 Answers1

2

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.

Mariya Davydova
  • 1,353
  • 9
  • 14