YouTrack Standalone 2017.2 Help

Entities

Workflow module Entities from package @jetbrains/youtrack-scripting-api

Contains definitions for the entities in YouTrack that are accessible to workflows.

Module functions

 

actionFunction

actionFunction(ctx, ctx.issue, ctx.currentUser, ctx.isSilentOperation)

This function is called by different events depending on the rule type:when a change is applied to an issue (on-change rules), when a command is executed (action rules),or according to a predefined schedule (scheduled rules). This function is called separatelyfor each related issue.

action: function(ctx) { console.log('Action for issue ' + ctx.issue.id); }

Parameters:

Name

Type

Description

ctx

Object

The execution context. Along with the parameters listed below,the context also contains objects that you describe in the Requirements.

ctx.issue

Issue

The current issue.

ctx.currentUser

User

The user who executes the rule.

ctx.isSilentOperation

Boolean

When `true`, the rule is triggered in reaction to a command that is applied without notification.When `false`, the rule is triggered in reaction to a command that is applied normally. Available since 2017.4.38771.

 

guardFunction

guardFunction(ctx, ctx.issue, ctx.currentUser)

This function is called to determine whether an action function can be applied to an issue.Guard functions are used in on-change rules, action rules, and in transitions between values of a state-machine rule.On-schedule rules also support guard functions, but this rule type includes a `search` property that has a similar purpose.

guard: function(ctx) { return ctx.issue.State.isResolved; }

Parameters:

Name

Type

Description

ctx

Object

The execution context. Along with the parameters listed below,the context also contains objects that you describe as Requirements.

ctx.issue

Issue

The current issue.

ctx.currentUser

User

The user who executes the rule.

 

Last modified: 7 March 2019