Retrieve a single field value from JIRA in Confluence.

The goal is to build a Confluence page from a template. This template uses a variable that will contain on JIRA issue key. We use a user macro that passes that key as part of a JQL query to the regular JIRA macro. The result is as usual wrapped in a table.

Now I wonder if you know any possibility to retrieve just one field value and return it to Confluence without any markup around, so e.g. it can be used in floating text.

My attempt to find an answer even by excessive googling so far was unsuccessful. So if you can share resources that clarify my issue, please feel free to do so.

2 answers

1 accepted

0 vote
Steven Behnke Community Champion Nov 22, 2016

This is not possible out of the box. There are some add-ons that accomplish this, such as this one.

Thank you for your answer, Steven!

Using this add-on, is this possible to get Jira "Components" system field and it's values return it to Confluence page e.g. it can be used in floating text?

So I hacked together some code quickly to resolve this issue (I created a user macro for it):

<script>
AJS.toInit(function(){
 setTimeout(function(){    
  AJS.$(".jira-table").each( function() {
   if (AJS.$(this).find( "td" ).length == 1) {
    var text = AJS.$(this).find(AJS.$("td.jira-macro-table-underline-pdfexport")).text();
    AJS.$(this).html(text);
   }
  });
 }, 500); 
});
</script>

 

Hi Paul,

what it doesn, means is it possible to get Jira "Components" system field and it's values return it to Confluence page for users selection using this User Macro - please confirm.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

488 views 19 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you