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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

372 views 20 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