Refer to issue type by its name in Behaviour script

Hubert Sękowski October 18, 2019

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.IssueTypeManager

IssueTypeManager issueTypeManager = ComponentAccessor.getComponent(IssueTypeManager)

issueTypeManager.getIssueType( getFieldById("issuetype").value.toString() ).name

1 comment

Comment

Log in or Sign up to comment
Leo
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 18, 2019

Hi @Hubert Sękowski

below snippet may help you

def issueType=getIssueContext().getIssueType().name

if(issueType == 'Task'){

  //your code

}

 

BR,

Leo 

Like Hubert Sękowski likes this
Hubert Sękowski October 18, 2019

Thnx @Leo 

Your code does the job and is shorter , so preferable :)

TAGS
AUG Leaders

Atlassian Community Events