Hello everyone,
My plan is to retrieve a user’s current line manager via API.
Since there is no REST API endpoint for this, I checked the graphQL functions and actually found a query that should do exactly that.
After a few initial problems where my parameters were wrong, I created a query that should work.
However, I always get an empty list even though there is a manager assigned. And both are managed account is this Site/Org
For testing purposes, I am currently running the calls manually.
Endpoint:
home.atlassian.com/gateway/api/graphql
I also tested the base url of the current site
Header:
Content-Type: application/json
Authorization: Basic {{jiraUsermail}} {{jiraUserToken}}
X-Query-Context: ari:cloud:platform::site/oo00oo00oo00oo00
X-Force-Dynamo: true
body:
{
"query": "query getManager ($aaid: ID!){teamworkGraph_userManager(userId: $aaid)@optIn(to: \"TeamworkGraphContextAPIs\") {version edges{cursor node{columns{key value{ ... on GraphStoreCypherQueryV2AriNode { id data { ... on AtlassianAccountUser { id email}}}}}}}} }",
"variables": {
"aaid": "ari:cloud:identity::user/xx00xx00xx00xx"
}
}
formatted query:
query restApi($aaid: ID!) {
teamworkGraph_userManager(userId: $aaid) @optIn(to: "TeamworkGraphContextAPIs") {
version
edges {
cursor
node {
columns {
key
value {
... on GraphStoreCypherQueryV2AriNode {
id
data {
... on AtlassianAccountUser {
id
email
}
}
}
}
}
}
}
}
}
actual response:
{
"data": {
"teamworkGraph_userManager": {
"version": "V3",
"edges": []
}
},
"extensions": {
"gateway": {
"request_id": "cbad2114-6eb0-4b8b-a5d2-64abbf3299ad",
"trace_id": "cbad21146eb04b8ba5d264abbf3299ad",
"crossRegion": false,
"edgeCrossRegion": false
}
}
}
In contrast the teamworkGraph_teamUsers query works just fine when I call it in the same manner.
I’m at a loss now. Does anyone have any idea how the query works? Or is it actually a bug?