Setting Group Picker in post-function after converting issue to sub task Edited

Hi,Custom group picker field name is active users. the following script works pretty good while creating issue. Main/Parent issue picks project admin and subtask based workflow picks jira-users group automatically according to the script.

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.util.IssueChangeHolder

//Get Issue Object
Issue issue = issue //The issue object is internally retrieved in the post-function

//Get instance of Custom Field Manager
def customFieldManager = ComponentAccessor.getComponent(CustomFieldManager)

//Initialize variables to setup group picker & automation type custom field value
def groupManager = ComponentAccessor.getGroupManager()
def singleGroupCf = customFieldManager.getCustomFieldObject("customfield_11119")

def group = groupManager.getGroup("Project Admins")// for subtasks based workflow i use her jira-users//
List groupList = new ArrayList()
groupList.add(group)
IssueChangeHolder changeHolder = new DefaultIssueChangeHolder();
singleGroupCf.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(singleGroupCf), groupList), changeHolder)
issue.store()

 

But its not working while converting issue into subtask. I mean the custom group picker field is not picking jira-users group automatically.if anyone,can give a solution for me ,it would be helpful

0 answers

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

172 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you