Hi,
I have a custom field that contains issue key, I'm trying set "Epic Link" field with this issue key with the following script with no success :
import com.atlassian.jira.component.ComponentAccessor
// Get issue key from custim field
def sourcefield = getFieldById(getFieldChanged())
def sourcefieldVal = getFieldById(getFieldChanged()).getValue()
//Get Epic link Field
def epicLink = getFieldByName("Epic Link")
//check Action in Create and
if(actionName == "Create" && epicLink != null ){
//Set epic link
epicLink.setFormValue(sourcefieldVal)
}
Can anyone help me with this?
Thanks.
Hello @Michael Shechter
Setting issue key in epic link name is enough. It should work.
But i have some questions about your code.
You have some custom field(sourceField) that contains issuekeys of epics? Am i right? And are they all have epic issue type?
And condition is: If (create screen and epic link already setted) then set link to epic from custom field. Right?
Hi @Mark Markov,
Yes, the "source field" is single Text line and contain one issue Key of epic.
I wrote the wrong condition the condition should be:
if(actionName == "Create" && sourcefield != null ){
//Set epic link
epicLink.setFormValue(sourcefieldVal)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.