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("example@example.com", "<api_token>")
.header("Accept", "application/json")
.asJson(); and adding a static project key to find my versions.
Any other, more efficient ideas?