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
Hi Markus.
Currently we do not support behaviours for JIRA. I'm actually the developer assigned to this feature.
You can follow the development of this issue here:
https://productsupport.adaptavist.com/browse/SRJIRA-2563
Cheers!
DYelamos
Hi Daniel,
thanks for the update. Sad to hear, that this isn't working, but good to hear, that it's already adressed. I will watch the issue.
Cheers
Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Markus.
No problem. Could you please accept my answer so that other users know that this question has been solved?
Cheers
DYelamos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Assets / Insights have the key of the Insightobject therefore:
def asset = Assets.search(/objectType ="YOUROBJ" AND Name = "YOURLABEL"/)
def key = asset.next()?.getObjectKey()
getFieldByName("YOURFIELD").tap{
setDescription(key)
setFormValue(key)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.