YouTrack Standalone 2021.3 Help

Default Description

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

Name@jetbrains/youtrack-workflow-default-description
Auto-attachedno
ModulesInsert 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

const entities = require('@jetbrains/youtrack-scripting-api/entities'); const workflow = require('@jetbrains/youtrack-scripting-api/workflow'); exports.rule = entities.Issue.onChange({ title: 'Insert default description template for external users', guard: (ctx) => { const issue = ctx.issue; return !issue.isReported && !issue.becomesReported && issue.description === null; }, action: (ctx) => { ctx.issue.description = workflow.i18n('What steps will reproduce the problem?') + "\n\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("Provide a screenshot if possible") + "\n"; }, requirements: {} });

Last modified: 08 March 2021