Adaptavist Script Runner for Jira Cloud is a different beast to its server/DC cousin.
Can anyone direct me to some example scripts? For example, I am trying to create a sub-task and populate the summary of the sub-task based on a prefix and the parent summary. Relatively straightforward on Server, but "different" on Cloud. I would also like to populate other custom fields in the subtask (in most cases just a copy from the parent).
Any examples I can use?
Thank you for your question.
I can confirm that you cannot use the same code that you would use in ScriptRunner for Jira Server inside of ScriptRunner for Jira Cloud because Atlassian only provides a rest API in Jira Cloud and does not provide a Java API in the cloud like they do in Jira Server.
You can see more detailed information on the differences between the cloud and server versions inside of our documentation page located here.
We would recommend reviewing the documentation for ScriptRunner for Jira Cloud which is located here along with the Jira Cloud Rest API Documentation in order to see how the REST API's work in Jira cloud.
As for examples, I would advise reading the knowledge base article which we have created located here which explains how to start learning the ScriptRunner for Jira Cloud plugin.
I would also advise reading through the documentation site located here which contains examples of how to common actions on the Script Console and Script Listeners page.
Finally, I would advise looking at the Create Subtask built-in post-function script which the script provides located here. I can also confirm that the example located here shows how to copy the assignee from the parent issue and may be a useful reference to show how you can create additional code to copy values from the parent issue.
If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.
Kristian, as always, has given you a much better answer than I usually would (I'm blunt, minimal and tend to focus on one single thing. Whereas Kristian will give you a lot of information and options), but he did miss one resource I would want to mention as well.
https://library.adaptavist.com/ is also worth a look when you're writing scripts. I'm pretty sure Kristian has written a good amount of the content in it too!
We’re excited to introduce external collaboration for Confluence, now available in early access. It is available to preview for Confluence Cloud Premium and Enterprise customers. (If you're not on ...
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