Set issue summary to cascading select value on create

Hi all,

I'm using the below groovy script to set the issue summary of a sub-task to the value of "Product" (a cascading select field in the same sub-task) on create. (I took snippets from it doesn't seem to be working).

Any suggestions are much appreciated!

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.customfields.view.CustomFieldParams
import com.atlassian.jira.issue.customfields.option.Option

Issue issue = issue;

ComponentManager componentManager = ComponentManager.getInstance();

CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();

CustomField customField = componentManager.getCustomFieldManager().getCustomFieldObjectByName("Product");

Object productValue  = issue.getCustomFieldValue(customField)?.getValue();

CustomFieldParams params = (CustomFieldParams) productValue;
if (params != null) {
Object parent = params.getFirstValueForNullKey();
Object child = params.getFirstValueForKey("1");

issue.summary = issue.summary + productValue;

1 answer

I have used below code to get the value from single group picker field. This may give you some hint:

def cfg = customFieldManager.getCustomFieldObjects(issue).find { == "Assignment Group"}

def cfgvalue =(List<Group>)issue.getCustomFieldValue(cfg)

String Agroup = ""

for(Group group:cfgvalue){

Agroup = group.getName()


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

808 views 3 9
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