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
-->
Hello @Tselun Tsai,
Thank you for reaching out to Atlassian Community!
I saw that you created a ticket with our support related to the same question and you said that you contacted the vendor and the issue was resolved.
Please, feel free to share the resolution here to help other community members that may have the same question.
Regards,
Angélica
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.