YouTrack Standalone 2020.3 Help

Watcher by Votes

This workflow automatically sets the project owner (referenced in the code as project lead)as a watcher when an issue receives a specific number of votes.

Name

@jetbrains/youtrack-workflow-watcher-by-votes

Auto-attached

no

Modules

Add project lead to watchers list when an issue receives 10 votes (on-change rule)

Use Case

This workflow helps you automatically raise the visibility of an issue when it receives a specific number of votes. You can customise this workflow to add other users as watchers or modify the number of votes.

Modules

When an issue receives ten votes, this rule automatically sets the project owner as a watcher for the issue.

Add project lead to watchers list when an issue receives 10 votes

var entities = require('@jetbrains/youtrack-scripting-api/entities'); var workflow = require('@jetbrains/youtrack-scripting-api/workflow'); exports.rule = entities.Issue.onChange({ title: workflow.i18n('Add project lead to watchers list when an issue receives 10 votes'), guard: function(ctx) { return ctx.issue.oldValue(votes) <= 9 && ctx.issue[votes] >= 10; }, action: function(ctx) { ctx.issue.project.leader.watchIssue(ctx.issue); }, requirements: {} });
Last modified: 28 October 2020