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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • 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

ScriptRunner issues on conditions

Trying to have scriptrunner listener run on jira cloud but only if the issue has a label matching "foo". I have the following but just get an error:

("foo" in issue.fields.labels)

2020-08-20 20:13:45.395 ERROR - The condition: ("foo" in issue.fields.labels) evaluated to: ["Jira expression failed to parse: line 1, column 19:\nexpression expected, reserved keyword 'in' encountered."]

1 answer

Hi Sean,

I can confirm that the ScriptRunner for Jira Cloud plugin provides Evaluate Condition feature for Script Listeners using the Jira Expression Framework as documented in the Atlassian API documentation page located here or in the documentation page located here.

We can confirm that when viewing the Jira Expression Framework API documentation page linked above you can navigate to the Context variables section which shows what variables are provided by this framework that can be used to create the expression.

If you then click on one of the variables it will show all the properties that can be called on the variable for the expression such as for the issue variable as shown here.

I can confirm that this shows the labels field is a List type which means it only supports being accessed using the methods documented in the expression API documentation page located here.

I can confirm based on this I have created the example located here which shows on line 18 the expression to check when the label field includes a specified label.

I would recommend using these documentation pages linked above as a reference guide to help to create the condition expression that you require.

I hope this information helps.

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira

Jira Cloud Performance Improvements

Hello everyone, I am a product manager in the Jira Cloud team focused on making sure our customers have a delightful experience using our products. Towards that goal, one of the areas which is extr...

184 views 2 9
Read article

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