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

Adaptavist Script Runner for Jira CLOUD examples

Roy Chapman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 7, 2019

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?

Roy

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
3 votes
Answer accepted
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 8, 2019

Hi Roy,

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.

Regards,

Kristian

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 9, 2019

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!

Like # people like this
TAGS
AUG Leaders

Atlassian Community Events