Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to list all projects in Script Runner? Edited

Objective: Release a projects' version using Jira Cloud Script Runner (groovy). Ideally, when a ticket is transitioned to a certain workflow status, the script runner will release the version associated with the ticket. 

Problem: How do I list all the software projects? 

I've searched the documentation looking for a way to get all projects + the versions that are included  in the project to no avail. It seems unirest isn't able to import projects like it would import a trigger issue.

I have considered calling: 

HttpResponse<JsonNode> response = Unirest.get("/rest/api/2/project/{projectkey}/versions")
.basicAuth("", "<api_token>")
.header("Accept", "application/json")

 and adding a static project key to find my versions.

Any other, more efficient ideas?

2 answers

1 accepted

1 vote
Answer accepted

Hi Mitch,

Thank you for your question.

I just wanted to share that we have an example script on how to copy the versions between projects located in the documentation page here.

I can confirm that the rest call in the versions variable shows the syntax for a rest call that can return all versions for a project and that this may be useful as a reference guide for an alternative way to achieve your requirement to what has been posted above.



Hey Kristian,

Does the documentation you sent apply to Script Listeners on Jira Cloud ? Static checking is throwing an error..Here's my snippet:

def versions = Unirest.get("${projectName}/versions")
.basicAuth("", "eNX0Z7bHi65PLuTfhWYm9F8D")
.header("Accept", "application/json")

// ("${response}")

versions.each {
boolean releasedValue = it.released
boolean userReleaseValue = it.userReleaseDate

 Error for the releaseValue:

No such property: released for class: java.lang.Object

HI Mitchell,


The snippet I shared was froo the Script Console and may need to be modified for a Script Listener to get any properties you require depending on what events you configure the listiner to run for. 



This can be closed.

Iago Docando Community Leader Jul 08, 2020

Hello, Mitchell. In your message from Oct 31. you're exposing your user and password for the world to see. You may want to remove that ;)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

Staying organized with Jira: best practices for a better project management

Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...

233 views 2 1
Read article

Community Events

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

Events near you