hello
is there an option to set default value to Linked Issue field base on the selected Issue Type,
I tried few script in script runner (behaviours) none of them works.
here example of the script I tried to config:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.*
def issuetype = getIssueContext().getIssueType().name
def linkedIssue = getFieldByName("Linked Issue")
linkedIssue.setFormValue(null)
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()
def customField = customFieldManager.getCustomFieldObject(selectcf.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
if (issuetype.contains("Bug")) {
def optionsMap = options.findAll {
it.value in ["is bug of"]
}.collectEntries {
[
(it.optionId.toString()): it.value
]
}
linkedIssue.setFieldOptions(optionsMap)
}
else........
Hi, @IDO GAFSON .
This code returns any error? If yes, put the error log here
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.