Snippets

Adaptavist Jira Cloud Create Sub Task Post Function Additional Code Examples

You are viewing an old version of this snippet. View the current version.
Revised by Kristian Walker a9388bb
/*
 * "The code below should be added to the 'Additional Code' box on the Create subtask postfunction in order to set the assignee on the subtask to the assignee of the parent issue 
 * 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." 
 */

// Get the assignee from the parent issue
def parentIssueAssignee = issue.fields.assignee.name
// Define the map required to set the assignee
def user = [name: parentIssueAssignee] as Map
// Set the assignee of the subtask
subtask.fields.assignee = user
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.