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

Accepted Answer
0 votes
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
Community showcase
Published Oct 09, 2018 in Confluence

Introducing Praecipio Consulting, an Atlassian Solution Partner

Hey there Community!  My name is Vannya Vallejo, the Channel Communication Specialist at Atlassian and I want to help Atlassian users like you learn about our Solution Partners and how they c...

381 views 0 9
Read article

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