Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Group issues into structure using scriptrunner Edited


I need to add multiple generator in my script,

like insert JQL query , group by, sort 

I am able to execute Insert JQL query but same method is not working for group by.

Please give us some your valuable suggestions.


1 answer

Hi @Jaspreet Kaur 

It depends on what kind of grouping you need to do. Please, check CoreStructureGenerators and CoreGeneratorParameters in our Java doc.

Egor Tasa

ALM Works

Thanks @Egor Tasa _ALM Works_ , I want to group issues using "group  by Phase", i didn't find any appropriate function for the same.

Hi Jaspreet,

Is Phase a text field or version or other field?


Hi Egor,

Phase is a text field.

//def params = [(CoreGeneratorParameters.FIELD_ID): Phase] as Map
def grouperId = generatorManager.createGenerator(CoreStructureGenerators.GROUPER_FIELD,Phase,structureId)
def generatorItem1 = CoreIdentities.generator(grouperId)
def forestSource1 = forestService.getForestSource(ForestSpec.structure(structureId))
forestSource1.apply(new ForestAction.Add(generatorItem1, 0, 0, 0)


I am trying to do this way, but it is not worked.

Hi Jaspreet,

You'll need to use  GROUPER_TEXT instead of GROUPER_FIELD, otherwise, it looks fine to me.


Hello @Egor Tasa _ALM Works_ ,

I did the same but it didn't given me appropriate result.

final fieldId = customFieldManager.getCustomFieldObjectByName("Phase")

def para = [(CoreGeneratorParameters.FIELD_ID):"Phase"] as Map
def grouperId = generatorManager.createGenerator(CoreStructureGenerators.GROUPER_TEXT, para, structureId)
def gen = CoreIdentities.generator(grouperId)
def fore = forestService.getForestSource(ForestSpec.structure(structureId))
fore.apply(new ForestAction.Add(gen,0,0,0))


Expected OUTPUT: Group by Phase: and all issue should moves to their respective phases


Above Code gives below output:JiraStructureissue.PNG

Hi Jaspreet,

Grouping by text field is done by Group by Attribute and text field as a parameter. But maybe I am missing something, let me consult with developers.


Apparently, parameters are the problem, for a text field these should be:

"attribute": {
"id": "customfield",
"params": {

Suggest an answer

Log in or Sign up to answer
Site Admin
Community showcase
Published in Marketplace Apps & Integrations

🤺 Atlympic Event: Partnerships

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

44 views 0 0
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you