Require attachements for new issue

Hi there,

Is there a way to require a file attachment when a new issue is created ? 


Thank you

Comment actions Permalink

Hello Bsoos !

Yes, it is possible to do this using the workflows. Here is a simple workflow that requires all new issues to have an attachment:

const entities = require('@jetbrains/youtrack-scripting-api/entities');
const workflow = require('@jetbrains/youtrack-scripting-api/workflow');

exports.rule = entities.Issue.onChange({
title: 'Check for attachments',
guard: (ctx) => {
return ctx.issue.becomesReported && ctx.issue.attachments.isEmpty();
action: (ctx) => {
const issue = ctx.issue;
workflow.check(false, 'Please add the attachment!');
Comment actions Permalink

Thank you !


Please sign in to leave a comment.