Developer Portal for YouTrack and Hub Help

Deactivate Voting for Issues

There are several scenarios where you think voting for issues is inappropriate for specific projects or is simply something you'd rather your team didn't pay attention to. While there isn't an option to switch voting off system-wide, you can effectively deactivate the feature with a simple workflow.

Switch Voting Off for All Issues

The following workflow checks for updates in an issue. If the user attempts to update the issue by voting for it, the action is blocked and a message is shown as an alert.

const entities = require('@jetbrains/youtrack-scripting-api/entities'); const workflow = require('@jetbrains/youtrack-scripting-api/workflow'); exports.rule = entities.Issue.onChange({ title: 'Block votes for issues', guard: function(ctx) { return ctx.issue.isChanged('votes'); }, action: function(ctx) { workflow.check(false, 'Voting for issues is switched off in this project'); }, requirements: {} });

This effectively blocks users from adding votes to any issues that belong to a project where this workflow rule is active. Note that this workflow blocks all changes for votes, which means it will also prevent users who have already voted from an issue from taking their votes back.

Block Votes for Resolved Issues

YouTrack also supplies a default workflow that lets you block votes in issues that have already been resolved. Voting for unresolved issues is still allowed.

To learn more about this workflow, see Vote Blocker.

Last modified: 23 April 2024