Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ScriptRunner - Groovy - get Insight Custom Field Options

Markus May 29, 2018

Hi,

 

I try to pre-fill an Insight custom field with ScripRunner Behaviours.

Basically I am struggeling getting the options out of the custom field I want to prefill. Here's the code I use so far (with some logging)

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager

def field = getFieldByName("SP Anzahl RAM")
def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObject(field.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)

Debugging this I get the following content of config: "com.atlassian.jira.issue.fields.config.FieldConfigImpl@d59871da" 

and options seems to be empty "[]"

 

what am I missing?

 

Thank you

Markus

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Daniel Yelamos [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 30, 2018

Hi Markus

I've marked this as a duplicate of this:

https://community.atlassian.com/t5/Jira-questions/JIRA-ScriptRunner-Insight-Groovy-get-Insight-custom-field-value/qaq-p/806911

Please don't double post :)

Closing this thread!

Cheers!

DYelamos