I am trying use Scriptrunner's "Create a sub-task" post-function to automatically create a subtask on a particular transition when number custom field (named "# Maps") has a value above 25. We'd like to create a subtask for checking maps when the parent issue indicates there are a lot of maps.
I can't figure out the syntax for the post-function's condition. Below is basically what I need, but of course, the ">=" isn't valid.
cfValues['# Maps'] >= '25'
Jira Server v7.9.2
ScriptRunner v5.4.12
Any ideas? Thanks in advance!
Even though your custom field is numeric, perhaps the cfValues[] array treats all custom fields as strings. Try casting to an int, i.e.
(int)cfValues['# Maps'] >= 25
Gave it a quick test, and that appears to have done the trick!
Much obliged!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.