Is there an equivalent of $spaceManager.getAllSpaces() for the jira projects?
I am searching something like: #set($projects = $projectManager.getAllProjects())
I would like to create a user macro in Confluence that lists all the jira projects, their administrators, and the users (and/or groups)
Confluence has Spaces, Jira has Projects - regardless of whether you have application link between the 2 or not, you cannot use Jira's API inside Confluence - they're 2 totally separate boxes.
So you would need to GET (likely via an HTTP request) that data from Jira, and then parse the data into the macro.
Do you have ScriptRunner in Jira? If so you could create a REST endpoint which would return the data as json, then it should be relatively straightforward to call that endpoint from Confluence macro and parse the json.
If you don't have ScriptRunner then this becomes quite a bit more complicated.
Depends on the use case, but imo I wouldn't be trying to do this in Confluence, because everytime you open that page, it would have to go through the whole get, parse, not to mention the strain this could put on Jira if that script is resource taxing, which it easily can get. I don't think this is a good approach just from performance standpoint - you don't want to be generating that data all the time, there needs to be a scheduled job of sort (maybe daily), or some form of caching I'd say.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.