Hi,
I am using ScriptRunner to create some fragments to give me additional options behind the 'More' button within a project. I have corresponding behaviours that take the names of these fragments and creates a new linked issue. Works perfectly, however the only 'issues-linktype' that it works with is "relates to", it fails to create the link on either the underlying issue or the newly created one with any other 'issues-linktype'. The code is below. Any ideas as to why this is not working?
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
if (getBehaviourContextId() == "create-issue-pmo") {
getFieldById("project-field").setReadOnly(true)
getFieldById("issuetype-field").setReadOnly(true)
def contextIssue = issueManager.getIssueObject(getContextIssueId())
getFieldById("issuelinks-linktype").setFormValue("relates to").setReadOnly(true)
getFieldById("issuelinks-issues").setFormValue(contextIssue.key).setReadOnly(true)
getFieldById("assignee").setFormValue(contextIssue.assigneeId).setReadOnly(false)
}