Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@eddiewebb
Created January 11, 2023 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddiewebb/eb0bbf169c0a4810cdfd922c3c60bb45 to your computer and use it in GitHub Desktop.
Save eddiewebb/eb0bbf169c0a4810cdfd922c3c60bb45 to your computer and use it in GitHub Desktop.
Jira Product Discovery Insights Contributions

Pulls Insight Contribution count from JPD

  • Container == issue, and is the ARI id formatted as <ari>/issue/<id> ari:cloud:jira:123456-7890-4681-8327-40539f3855d1:issue/129565

  • Project ID similar but using /project/ ari:cloud:jira:123456-7890-4681-8327-40539f3855d1:project/11277

Grpahql

You can use browser auth by visisitng YOURAITE.atlassian.com/api/gateway

Here I pull the contributions for 3 specific issues I looked up

query MyQuery($projectId: ID!,$A: ID!,$B: ID!,$C: ID!) {
  apples: polarisInsights(project: $projectId, container:$A ) {
    ...PolarisInsightFragment
  },
  bananas:polarisInsights( project: $projectId, container:$B ){
    ...PolarisInsightFragment
  }
  polarisInsights(project: $projectId, container:$C ) {
    ...PolarisInsightFragment
  }
}


fragment PolarisInsightFragment on PolarisInsight {
  created
  account {
    name
  }
  snippets {
    id
    url
  }
}

JQ to sort it

Turn multiple query result into leaderboard

.data | add  |  group_by (.account.name ) \
| map({"name":.[0].account.name, "count": (.  | length)}) \
| sort_by(.count)  | reverse  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment