How to get parent issue type

Originally asked by KyoungMan Kim on 20 May 2021 (original question)


Hello,

We want to know how to find the parent issue type name when child tasks are synchronized, because we have to use different logic depending on the parent issue type.

Please give us good advice for resolving our problem.

Thanks


Answer by Francis Martens (Exalate) on 22 May 2021

In the outgoing sync you can lookup the parent issue using the issueManager

Outgoing sync - UNTESTED

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager;

IssueManager im = ComponentAccessor.getIssueManager()

def parentIssue = im.getIssueObject(issue.parentId)
def parentIssueTypeName = parentIssue?.issueType?.name