YouTrack Standalone 2021.1 Help

Vote Blocker

This workflow locks an issue so that users cannot vote for the issue after it is resolved.

Name@jetbrains/youtrack-workflow-resolved-votes
Previous TitleDo Not Vote for Resolved Issue
Auto-attachedno
ModulesBlock votes for resolved issues (on-change rule)

Use Case

This workflow helps you keep users from voting for issues that are already resolved.

Modules

When a user votes for an issue, the on-change rule in this module verifies that the issue is already in a state that is Resolved.

  • If the issue is not resolved, the vote is added to the issue.

  • If the issue is resolved, a warning is displayed. The vote is not added to the issue.

Block votes for resolved issues

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 resolved issues', guard: (ctx) => { return ctx.issue.isResolved; }, action: (ctx) => { workflow.check(!ctx.issue.isChanged('votes'), workflow.i18n('Voting for a resolved issue is not allowed.')); }, requirements: {} });

Last modified: 08 March 2021