Hi team
On JIRA service management portal, I have a two request types called "Feedback" and "New change"
On my Feedback form I have a issue picker field(Script runner field) called "Change ticket link" to select "New Change" issues,
When I select any issue in Issue picker field, If any linked issues already with selected New change request, those linked issues I need to set as "Change ticket link" description.
I have written this code on my behavior help me to complete this?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.properties.APKeys
import com.atlassian.jira.datetime.DateTimeFormatter
import com.atlassian.jira.issue.customfields.impl.DateTimeCFType
import com.atlassian.jira.issue.fields.CustomField
import com.onresolve.jira.groovy.user.FieldBehaviours
import org.apache.log4j.Logger
import org.apache.log4j.Level
import groovy.transform.BaseScript
import java.sql.Timestamp
import java.text.SimpleDateFormat
@BaseScript FieldBehaviours fieldBehaviours
// Set the log level
def log = Logger.getLogger(getClass())
log.setLevel(Level.DEBUG)
// The issue picker field name param and also the field this behaviour is connected to in the behaviour
final issuePickerFieldName = "Change ticket link"
def links = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())
getFieldByName("TextField").setDescription("${links}")