The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new comments.

Leo
Community Champion
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