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."]
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.
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...
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