Im using Script Runner post function to create a linked issue, but i also want to use the "Additional issue actions" to set a field (select list) value on linked case.
I have this but it stops the linked case from being created all together.....
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
def formField = getFieldByName("Field Name 1")
def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObject(formField.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
def optionToSelect = options.find {
it.value == "Value 1"
}
formField.setFormValue(optionToSelect.optionId)
Hi @Rob B
From your description:-
Im using Script Runner post function to create a linked issue, but i also want to use the "Additional issue actions" to set a field (select list) value on linked case.
I have some doubts to clarify with you, i.e.
1. Do you want the Additional issue actions to be updated using Behaviour?
2. If it is for the Behaviour, could you please share a print screen of your Behaviour configuration?
3. And is it configured for either a Server-Side Behaviour or Initiliser?
If it is configured for a Server-Side Behaviour, this code will not work.
For the Server-Side Behaviour, you need to declare the field the Behaviour is configured for like this:-
def field = getFieldById(fieldChanged)
For more information on the Behaviours, you can visit the Adaptavist Documentation.
I am looking forward to your feedback.
Thank you and Kind Regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.