/* * This script provides some example expressions which can be added as 'ScriptRunner Script Conditions* inside of ScriptRunner for Jira Cloud'. * The conditions must written as a Jira Expression using the expression framework which Atlassian document at: https://developer.atlassian.com/cloud/jira/platform/jira-expressions/ * All right, title and interest in this code snippet shall remain the exclusive intellectual property of Adaptavist Group Ltd and its affiliates. Customers with a valid ScriptRunner * license shall be granted a non-exclusive, non-transferable, freely revocable right to use this code snippet only within their own instance of Atlassian products. This licensing notice cannot be removed * or amended and must be included in any circumstances where the code snippet is shared by You or a third party." */// We also have some example conditions for script listiners at http://scriptrunner-docs.connect.adaptavist.com/jiracloud/script-listeners.html#_evaluate_condition // which could be used as a reference guide to create workflow conditions. // The example below mandates that an issue must have at least one PDF attachment. issue.attachments.filter(attachment=>attachment.mimeType=='application/pdf').length>0// Specify that the current user must be in a list of users defined using the accountId for each user['accountIdHere','accountIdHere'].includes(user.accountId)// This example mandates that an issue must have at least one subtaskissue.subtasks.length>0// This example mandates that all subtask issues must be in the 'Done' statusissue.subtasks.filter(subtask=>subtask.status.name=='Done').length==issue.subtasks.length// This example mandates that all subtasks have an assignee setissue.subtasks.filter(subtask=>subtask.assignee!=null).length==issue.subtasks.length// This example mandates the current logged in user must of added at least one comment to the issueissue.comments.filter(c=>c.author.accountId==user.accountId).length>0
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.