Youtrack Workflow - Notify a group in a workflow

1.3k views Asked by At

I am trying to create a workflow for my project in Youtrack that will notify all members of a UserGroup when the state is set to an appropriate value - for example notify all members of the QA group when a task is set to Ready For QA.

Here is the code I have, taken from a larger state machine workflow:

on Approve do {
    {group: Quality Assurance}.notifyAllUsers("Task Ready for QA", "A task has been marked as Ready For QA: " + getId());
    Alpha Tested By = loggedInUser;
} transit to Ready For QA

Setting the Alpha Tested By values works, everything else works but the group notify. In the editor, the group notify line is highlighted in red, but there is no information about what the problem is. The group name is correct. I copied the syntax directly from the documentation here: https://www.jetbrains.com/help/youtrack/incloud/7.0/Workflow-Language-Grammar.html#literals

I am using the v7.0 InCloud hosted version of YouTrack.

1

There are 1 answers

0
Christof Aenderl On

I guess you use the "YouTrack Workflow Editor". Inserting is a bit nasty, copy-paste usually won't work.

Just navigate your mouse to the position you want to insert and hit ctrl + space (autocomplete). Start typing "{group" and you'll get the suggestion for {group: }.

enter image description here

Use again ctrl + space to get the right group-name. After group add the dot "." and once again ctrl + space to add the notifyAllUsers function.

This is my workflow which added issues moved to state "QA" onto a agile board for QA and sends notification to all users in group QA:

whenState.becomes({QA}) {
   sprints.add({QA Board.First sprint});
   {group:QA}.notifyAllUsers("New Task in QA: " + getId( ) + " " + summary, "Please check your QA board or open this task: " + getUrl( ));
}