You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I use post function and scriptrunner to run groovy script when the issue is closed. Initially the script was used with Jira server, I don't know that when I migrate the code to Jira cloud, how could it work. This is the libraries to be used:
@grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1' )
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
//== END HTTPBUILDER IMPORTS
If I want it to work with Jira cloud, which libraries are still compatible with?
I can confirm that in scriptRunner for Jira Cloud we work with Rest APIs only and that it is possible to write scripts that would interact with an external application such as Slack, as long as the application contains a REST API which can be called to interact with it. We have an example in our library script, which you can use as a reference guide when writing a script to make external requests.
In order to achieve this requirement, you should review the REST API documentation for the external application in order to see what REST APIs you will need to use to achieve this. We would advise contacting the third-party applications support team if you have any questions about how their third-party API works.
We have a documentation example located here which shows how you can post a message to Slack and this example may prove a useful reference in helping you to create the script that you require, as it shows an example of making an API call to an external REST API.
Finally, I can confirm Atlassian does not permit our app to access any of the private REST APIs they provide which means we are only allowed to access the public APIs they provide when calling the Jira Cloud API but for external APIs you can call them and can use the steps above to do this.
I hope this information helps.
When migrating to the cloud, script rewrites are necessary. Visit https://docs.adaptavist.com/sr4jc/latest/scriptrunner-migration/migrate-from-scriptrunner-for-jira-server-to-cloud/rewriting-scripts-for-cloud-hints-and-tips for guidance on modifying your scripts, where you should be able to find compatible libraries and more.