Hi All ,
I'am trying to create a subtask based on conditional execution. The condition is that if the issue already has one subtask existing then it should create. I'am using the statement/code as follows :
issue.getSubTaskObjects().size() == 1
I tested this in my local SERVER instance and it is working fine. However I could not make it work on my cloud system. Can anybody let me know why its not working ? Also, is there any other way i can validate(apply conditional execution) the subtask count on cloud system?
Thank you!
Swathi Komirelli
Hi Swathi,
JIRA Server and JIRA Cloud add-ons work in very different ways. We have written up some documentation around this here: http://scriptrunner-docs.connect.adaptavist.com/jiracloud/ and http://scriptrunner-docs.connect.adaptavist.com/jiracloud/migrating.html
Testing scripts on a JIRA Server instance before using it in JIRA Cloud will not work because ScriptRunner for JIRA Cloud does not have access to the same APIs.
The equivalent JIRA Cloud code to what you have written is:
issue.fields.subtasks.size() == 1
I hope that helps - feel free to ask more questions here or open a support request directly with us: https://productsupport.adaptavist.com/servicedesk/customer/portal/23/create/112
Jon
Hi @John Bevan,
Thanks for your inputs.The script you have provided is also not working. I tried other scripts based on the documentation,but none of them seems to work.
I raised a request with your support desk.
Regards,
Swathi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Retagging as @Jon Bevan [Adaptavist].
"Wherever we are, we are as one"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In cloud it is
issue.subtasks.length
instead of
issue.getSubTaskObjects().size()
See:
https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference/#issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.