Hi,
I am writing a script that I need to put in the workflow post function, my need is based on 2 fields values post function will execute it, but I am getting some errors[the variable is undeclared] when i run it on the script console., Please find the below that I'm using it.
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.component.ComponentAccessor;
def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = customFieldManager.getCustomFieldObject("customfield_10700")
def cField1 = customFieldManager.getCustomFieldObject("customfield_10728")
def cFieldValue = issue.getCustomFieldValue(cField)
def cFieldValue1 = issue.getCustomFieldValue(cField1)
if(cFieldValue.equals("1") && cFieldValue1.equals("yes")){
return true
}
Thank you.