Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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 display inline values from Jira REST api into confluence

Hello everyone,

 

My goal is to display the value of a Jira REST query result into a confluence page, inline with the text. I am aware of the /jira macro but that does not cut it as it renders ugly gray boxes that break the line.

 

Here an example of what I'd like to see in confluence and how in my head i'd like to get it done:

 

In my confluence page I've the following sentence as normal text:

  • "The value of the field is value"  - I'd like for the world value to be dynamically generated based upon the value of a Jira issue field.

The way i dream for this to work is:

 

Now this would get me the value of the field id: 123456 from the REST api for project PRJ-1 and display it as text in confluence.

 

What i don't want:

  1. Text displayed in tables that messes up the layout,
  2. text rendered by the /jira macro that disrupts the layout and doesn't sit in line with my paragraph,

 

Any direction is appreciated since i am new here and i am losing my mind around macros and other articulated concepts. Just some simple JSON parsing, HTLM, CSS or running some JS/Python somewhere would relieve my stress.

Thanks

1 answer

The out-of-the box Jira macro for Confluence returns values in tabular format. You're going to need something like ScriptRunner do to the REST based lookup behind the scenes and return some raw text that you can put on the page.

Alternatively, third party tools like the Stiltsoft Table Filters can manipulate the heck out of the data returned by the Jira macro and format it in all sorts of way on the Confluence page.

Hello,

I appreciate you taking the time to respond. Table filters seems to be doing just tables (as the name suggests) which is not very useful, unless you want to display data...in a table.

I've inquired Script Runner support, although from their description while it is evident you can query the Jira Api, it is unclear how much you can manipulate and display on confluence.

Yes, the output from the Stiltsoft Table filter will still be a table, but if you render the table with no borders, cell padding or colours, nobody will know it's there, all they'll see is the text. The table becomes an invisible container for the text, so it's the simplest solution. Still, in HTML, tables aren't truly inline with text

If you absolutely need the output in that table as text, inline in the page body, you might have to do some browser side page content manipulation with something like JQuery to 'unwrap' the content from the table and put it back in the same place.

The last resort would be to use ScriptRunner to get the value you want, but you'd have to write your own Confluence macro to take that value, put it inside the text, then render it on the page... but then you face a similar issue; macros get treated as separate objects on the page and can't just be inserted inline in any text, anywhere.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

113 views 0 3
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