Is there a way to find the linked spaces to a particular jira project . Use case is to identify if any spaces need to be migrated alongside side few selected projects from one site to another. For the time being, I am running through the issues individually so see the (mentioned in confluence page )section in the jira ticket.
Thanks
if you have ScriptRunner for Jira installed in data center, you can run:
issueFunction in linkedIssuesOfRemote(host, "<confluence url") and key= <issue key>
this JQL will return the issue if the "confluence url" is found in any fields for the specified key.
Ok, so I found some endpoints, but ugh, yeah, it's unofficial and undocumented, and WORSE STILL, it's GraphQL (nooooooo!)
⚠️ Use of Unofficial and Undocumented APIs is NOT RECOMMENDED for any production tasks or Automations. This information is strictly for informational, and possible one-time uses/runs/migrations etc. because they are inherently fragile and may break if Atlassian changes the API. (On the other hand, it’ll probably be fine.) |
But basically, here's the endpoint:
https://YOURSITE.atlassian.net/rest/gira/1/?operation=issueViewRemoteDataQuery
And the query (god I hate GraphQL):
{"query":" |
ANYWAYS, that is the query that produced the data for this in the Jira view of BUG-1:
So THEN, if you run this command (and miraculously it DOES work with an API Token) across all the issues in your project (sorry), you should be able to get a listing of all pages that mention issues in the project.
The only header I had to include in my curl test was this:
content-type: application/json
Anyways, so yeah, it's technically possible. Will just require making that call for all the issues in your project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's the "collapsed" version of the GraphQL call, with all the other bits I used in curl:
curl 'https://YOURHOST.atlassian.net/rest/gira/1/?operation=issueViewRemoteDataQuery' \
-s -n \
-H 'content-type: application/json' \
--data-raw $'{"query":"\\n query issueViewRemoteDataQuery($issueKey: String\u0021) {\\n bentoViewIssue_remote_data: viewIssue(issueKey: $issueKey) {\\n \\n issueId\\n remoteLinks {\\n isLinkingEnabled\\n confluencePages {\\n linkedPages {\\n \\n pageCount\\n \\n pages {\\n ... on ConfluencePage {\\n id\\n globalId\\n href\\n title\\n type\\n lastUpdatedContext {\\n \\n user {\\n key\\n accountId\\n emailAddress\\n avatarUrl\\n displayName\\n active\\n }\\n\\n }\\n }\\n ... on FailedRemoteLink {\\n id\\n error\\n link {\\n id\\n globalId\\n href\\n }\\n repairLink { href }\\n }\\n }\\n\\n\\n }\\n mentionedPages {\\n \\n pageCount\\n \\n pages {\\n ... on ConfluencePage {\\n id\\n globalId\\n href\\n title\\n type\\n lastUpdatedContext {\\n \\n user {\\n key\\n accountId\\n emailAddress\\n avatarUrl\\n displayName\\n active\\n }\\n\\n }\\n }\\n ... on FailedRemoteLink {\\n id\\n error\\n link {\\n id\\n globalId\\n href\\n }\\n repairLink { href }\\n }\\n }\\n\\n\\n }\\n }\\n \\n webLinks(allowThirdParties: true, orderBy: \\"-id\\") {\\n linkCount\\n links {\\n id\\n href\\n linkText\\n iconUrl\\n summary\\n resolved\\n relationship\\n applicationName\\n applicationType\\n }\\n }\\n\\n \\n remoteLinkedIssues {\\n preview {\\n \\n id\\n issueId\\n globalId\\n href\\n applicationType\\n applicationName\\n relationship\\n title\\n\\n }\\n details {\\n \\n ... on AssociatedIssueWrapper {\\n associatedIssue {\\n \\n issueId\\n issueKey {\\n stringValue\\n }\\n summary {\\n textValue\\n }\\n status {\\n statusCategoryId\\n name\\n statusId\\n }\\n priority {\\n iconUrl\\n name\\n }\\n issueType {\\n iconUrl\\n name\\n }\\n assignee {\\n userValue\\n {\\n displayName\\n avatarUrl\\n }\\n }\\n isResolved\\n\\n }\\n }\\n ... on FailedRemoteIssue {\\n error\\n repairLink { href }\\n }\\n\\n }\\n }\\n\\n }\\n\\n }\\n }\\n","variables":{"issueKey":"BUG-1"}}'
Aside from the --data-raw bit, the other flags for curl are:
-s = silent mode, so it skips display a little progress bar while making the connection
-n = netrc file. This specifies that curl will load in the authentication details (your email address + API token) from a .netrc file stored in your home directory. It's a super-handy way to keep the auth info for your host(s) in a file and avoid having to include them on the command-line with the --user or -u mode or having to include an Authorization header and base64 encoding stuff, which ugh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the Atlassian Community!
On the left frame of your project you should be able to see if it is linked to a Confluence space.
Let me know if you have any more questions.
Best,
Fadoua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank @Fadoua ,
May be I didn't explain the issue correctly. Linking the space/page to a project is a different thing. I am wondering how to get the list of spaces/pages linked to a project in terms to linked in jira tickets. for example
ABC-1 is linked to a page in space A
ABC-2 is linked to a page in space B
In the same way, I want to be able to list all the space that could be associated to Project ABC.
-Bibek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah I see. I don’t think it can be done even with a JQL.
If you had a custom field for Confluence links it would have helped. I don’t think you can do it without the use of a custom field.
Best,
Fadoua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.