Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Groovy expresion for issue types

Hi guys,

I am looking to add a set field value to constant or groovy expression post function which will check if the issue type = X and if the condition is true then a certain field gets populated.

I tried with the groovy expressions == "X" and"X".  Do you have any idea why isn't working?

I am using JIRA 7.2.6


1 answer

1 accepted

2 votes
Answer accepted
Tarun Sapra Community Leader Jul 28, 2017

This should work-

if( == 'Bug'){
//here you can add code to populate the field


 Which version of script runner plugin do you have installed, as this condition is very basic should work very easily. 

Hi Tarun,

Thanks for replying.

The post function looks something like this


I tried multiple approaches but nothing seems to work. Script Runner is version 4.3.12.



Tarun Sapra Community Leader Jul 28, 2017

I thought you are using script runner plugin thus I shared the groovy script with you, but it seems you are using JMWE plugin which also supports groovy script (new feature in the plugin)


Please use this syntax

return (issue.get("issuetype").getName() == "Bug")


Tarun Sapra Community Leader Jul 28, 2017

Please see the docs here in case you are using groovy expressions for the JMWE plugin - 

Hi @Tarun Sapra   how can we import Issue Type in Behaviors, Because when i am trying to use IssueType Object in Behaviors, its unable to import even if i have added import com.atlassian.jira.issue.IssueType; on top of my class. Can you suggest anything?

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you