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 Title | Do Not Vote for Resolved Issue |
Auto-attached | no |
Modules | Block 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
var entities = require('@jetbrains/youtrack-scripting-api/entities');
var workflow = require('@jetbrains/youtrack-scripting-api/workflow');
exports.rule = entities.Issue.onChange({
title: workflow.i18n('Block votes for resolved issues'),
guard: function(ctx) {
return ctx.issue.isResolved;
},
action: function(ctx) {
workflow.check(!ctx.issue.isChanged('votes'), workflow.i18n('Voting for a resolved issue is not allowed.'));
},
requirements: {}
});
Last modified: 28 October 2020