YouTrack Standalone 2019.2 Help

Default Description

This workflow inserts default text into the description field of a new issue.

Name

@jetbrains/youtrack-workflow-default-description

Auto-attached

no

Modules

Insert default description template for external users (on-change rule)

Use Case

This workflow provides users with a default description template for reporting issues.

Modules

When a user starts to report an issue, the on-change rule in this module checks the description field. If the description is empty, default text is inserted. The default text is inserted as soon as the user starts writing the summary or sets the value of an issue field. If the user immediately enters text in the Description field, the default text is not inserted.

Insert default description template for external users

var entities = require('@jetbrains/youtrack-scripting-api/entities'); var workflow = require('@jetbrains/youtrack-scripting-api/workflow'); exports.rule = entities.Issue.onChange({ title: workflow.i18n('Insert default description template for external users'), guard: function(ctx) { var issue = ctx.issue; return !issue.isReported && !issue.becomesReported && issue.description === null; }, action: function (ctx) { ctx.issue.description = workflow.i18n('What steps will reproduce the problem?') + "\n1.\n2.\n3.\n\n" + workflow.i18n("What is the expected result?") + "\n\n" + workflow.i18n("What happens instead?") + "\n\n" + workflow.i18n("Please provide any additional information below.") + "\n" + workflow.i18n("Attach a screenshot if possible") + "\n"; }, requirements: {} });
Last modified: 17 December 2019