How can I set a custom field value programically based on its parent issue type?
I need to modify the code below for a customer field with issue type of "design requirement". When its parent is an issue type called "Milestone", the value will be set with
issueObject.getParentObject().getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_10000")).getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_10002"));
That is the original code below. Now, I need to add the second condition. When its parent is an issue type called "NTO", the value will be set with
issueObject.getParentObject().getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_12904"));
Please help. Thanks in advance.
==========================================================
@Formula:
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.component.ComponentAccessor;
String s = issue.get("issuetype").getName();
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
if (s.equals("Design Requirement") return
issueObject.getParentObject().getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_10000")).getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_10002"));
return null
-->