While creating story we put ticket number in EPIC LINK .
I am trying to get the status of epic while creating a story using epic link .
While creating story we put ticket number in EPIC LINK .
if the status of the epic is done then don't allow to create story
Till now this is what i have done :
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.opensymphony.workflow.InvalidInputException
import org.apache.log4j.Logger
import org.apache.log4j.Level
def issue = issue as Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def epicLinkCf = customFieldManager.getCustomFieldObjectByName("Epic Link")
def epicLink = issue.getCustomFieldValue(epicLinkCf) as Issue
def st = epicLink.status
log.info("status :"+st)
if (st == 'Done')
{
invalidInputException = new InvalidInputException("Epic is completed please provide Epic which is not Complted")
}
for some reason its not working in the validator .