Jira query on mention in Confluence page

Erik Mathijs
Contributor
January 9, 2018

Hi,

We use Jira and Confluence and i want to query (in Jira) wich Jira issues are mentioned in a specific Confluence page.

This query should be usefull to use for integration testing.

Thanx in advance for you're help.

 

Kind regards,

 

2 answers

3 votes
Alex Christensen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 9, 2018

I don't know of a way to do this in Jira, but in Confluence, you can open a page and see a list of issues which have been linked to that Confluence page. I know it's not a Jira query, but this can at least get you the information you're looking for.

blog-600x-retina2x-5

Deepali Bagul
Contributor
May 4, 2018

Hi @Alex Christensen

This did  the trick. I had 6 issues on confluence page. clicking the lira link took me to the Jira search Navigation page and gave me the JQL. Thanks you made my day :)

Regards,

Deepali Bagul

Roman Tarakanov
Contributor
February 14, 2019

This also worked for me, but it was not trivial to pull off, so i will explain for posterity:

  1. You will need to have your confluence page created and link more than 5 issues to it manually.
  2. Go to the confluence page and click JIRA link reference at the top:
    jira_issues.jpg
    Note that if you have less then 6 issues linked you will not see "View X more in Jira
  3. Click the "View more" link, which will take you to JIRA search
  4. Copy the JQL query, which should look something like this:
    issue in (issuesWithRemoteLinksByGlobalId('appId=<APP_ID>&pageId=<PAGE_ID>'))

    Use that JQL to insert into Confluence page or create a custom search

You should also be able to construct this query yourself if you know the API ID (for jira integration) and Confluence page ID

Like # people like this
Tom Otvos
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!
November 6, 2020

Brilliant!

Sharif Omar November 10, 2020

Thanks for this. Worked for me as well. 

Raul Pelaez _TecnoFor - Marketplace Partner_
Atlassian Partner
June 17, 2021

Thanks Roman

BrianW
Contributor
January 12, 2022

This is a great find. I had some trouble figuring out my confluence cloud appID, but I eventually got it from /plugins/servlet/applinks/listApplicationLinks (Gear Menu-Products-Integrations, Application Links) by inspecting the table row element for System Confluence, where the id of that row turned out to be the APP_ID referenced above.

Like # people like this
Geoffrey GAUTHIER
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!
May 20, 2022

I noticed that for this to work, the jira links must be added as a "single request" jira macro and not as an "array". Anyone know how to list them all? I have a lot of tables in my confluence page, so I can't click at the bottom of the table to open them all at once

Grace Howard
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 24, 2023

Thank you for this!

Austin Shackelford
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!
March 28, 2023

@BrianW Thank you for providing the detailed instructions to find the confluence cloud appID. It's a convoluted process but it worked like a charm!

Giona Imperatori
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!
May 24, 2024

@BrianW hacky, but it works :)

0 votes
Sarah_Wright January 9, 2018

Well this is timely :) I was looking for something similar whereby I want to show the "mentioned in" links in a report so that I can create a quick way to access and update the related page in Confluence. Especially useful when trying to put together reports that are easy to use for the non-Confluence fans.

Alex Christensen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 9, 2018

think you can do this with ScriptRunner if you have that add-on installed. I haven't tested this, but here's a link their documentation that I think covers this:

https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_remote_issue_links

I don't think there's a way to do this without an add-on, though.

Sarah_Wright January 10, 2018

Cool. We have scriptrunner and the query works but now how do I show that field as column or in the report?

Alex Christensen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 10, 2018

There's no way to display remote links in the issue navigator. There was an open ticket with Atlassian to implement this, but it was closed with a resolution of "won't fix" (view details here). To see the specific page the issue is mentioned in, you'd have to open each individual issue, unfortunately.

You could do the following if you are looking for specific pages you need to update:

  • Create a new Confluence page.
  • Create a Jira macro on the page to display a list of issues using that query.
  • Above the list of issues, provide a link to the Confluence page URL that is used in that query.
Sarah_Wright January 10, 2018

Thanks for the ideas. I repurposed a simple text field that we have and input the Confluence page URL there. It's janky but seems to work OK as for me it's a 1:1 between the issue and the page.

Erik Mathijs
Contributor
January 10, 2018

We also have the scriptrunner plugin and it works fine.

In confluence we created a page with a high overview of pages and  via insert jira issue / filter an overview of jira issues mentioned on the page(s).

Like Adrison Vortigo likes this
Mathew Newton September 19, 2020

Hi Erik,

You mention pages so wanted to check to see if you have been able to pass in a parent page to get all the JIRA tickets mention on all the child pages:

The business need is that we have a review meeting each week which we have a confluence page for. On these pages we list JIRA tickets using the JIRA widget which we need to capture a list of for all meeting pages which are children of a parent meeting master page.

I can query the JIRA tickets mentioned in one page as follows:

  • issue in (issuesWithRemoteLinksByGlobalId("appId=355d447c-93b5-3592-bae6-75ed77555d5f&pageId=9601581"))

Based on my research so far the two options that I thought might work are:

  • issue in (issuesWithRemoteLinksByGlobalId("appId=355d447c-93b5-3592-bae6-75ed77555d5f&pageId in (ancestorsid:9601581)"))
  • issue in (issuesWithRemoteLinksByGlobalId("appId=355d447c-93b5-3592-bae6-75ed77555d5f&pageId in (parentid:9601581)"))

but these don't return any results.

I have spaces around the 'in' but adding %20 doesn't work.

Another approach could be that all the meeting page titles have a subset of words we can also query on.

I hope this is possible as if we can't we have two issues:

  • Having to manually add a new page filter to our dashboard each week, and
  • While we use status values to drop tickets off the list eventually allowing each page to be removed there is a limit to how long a jql query can be.
Amr ROQDI January 24, 2023

Hello Mathew, I'm facing the exact same difficutly.
Please tell me you found a solution on your side ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events