I need to Create a Script fragment to create a story. This button should be on epic screen.
When the button is clicked, the create issue screen should have epic link field populated by the epic link on which the button has been clicked(i.e like when the Sub task's parent field is populated when you click create sub task button on an issue screen)
I'm trying to do the same thing, i've linked my script fragment to a behaviour. Here's my code in the behaviour:
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
def contextIssue = issueManager.getIssueObject(getContextIssueId())
if (getBehaviourContextId() == "create-story-in-epic-link") {
getFieldById("project-field").setReadOnly(true)
getFieldById("issuetype-field").setReadOnly(true)
def epicLinkCf = customFieldManager.getCustomFieldObjectByName("Epic Name")
def linkedEpic = contextIssue.getCustomFieldValue(epicLinkCf) as Issue
getFieldByName("Epic Link").setFormValue(linkedEpic).setReadOnly(true)
}
The button is created properly, when i click on it, it triggers the Story popup creation screen, but it did not load the Epic key/name in the Epic Link :
any idea whats missing in my code?
thanks in advance!
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.