Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get jira project objects via User Macro (VTL) in Confluence

lindix
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!
February 23, 2023

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)

1 answer

0 votes
Radek Dostál
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.
February 23, 2023

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events