Workflow Conditions
This module is available in Script Master for Jira only.
Overviewβ
Script Master provides advanced workflow conditions for Jira Cloud. These conditions check requirements before enabling workflow transitions. They include checks like ensuring a summary starts with specific characters, verifying field populations, requiring a PDF attachment, or restricting transitions to certain users. Script Master uses the Jira Expressions for these conditions. Users can create and edit these conditions through the Script Master interface by navigating to the workflow, selecting the condition type, and configuring the necessary expressions.
Scripted Conditions implements Forge Jira workflow condition module.
Contextβ
Jira Expressions use JavaScript-like syntax. They support a subset of JavaScript constructs and features, here is a brief overview of some of the main ones:
user(User): The user the condition is evaluated for.issue(Issue): The issue selected for the transition.project(Project): The project the issue belongs to.transition(Transition): The transition that the condition is being evaluated against.workflow(Workflow): The workflow that contains the condition.
Examplesβ
Allowed Issue Typesβ
Transition is visible only if the issue type is included in the allowed list.
['Bug', 'Task'].includes(issue.issueType.name)
Current User Comment Verificationβ
Transition is visible only if the issue has a comment from the current user.
issue.comments
.filter(c => c.author.accountId == user.accountId)
.length > 0