Developer
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Last updated Oct 29, 2025

User has external position

The UserHasExternalPosition relationship represents the link between an Identity user and an external position within the Teamwork Graph. It allows you to:

  • Retrieve all external positions for a specific user
  • Find which user holds any given external position
  • Traverse and analyze user-position relationships

Relationship type: Canonical

From object typeTo object type
Identity user - ati:cloud:identity:userExternal position - ati:cloud:graph:position

Cypher

We recommend using parameterized Cypher queries rather than placing parameters directly in the query string. This helps improve performance.

Forward query

GraphQL
1
2
query UserHasExternalPosition_CypherQuery($cypherQuery: String!, $params: JSON!) {
 graphStore @optIn(to: ["GraphStore", "GraphStoreCypherQueryV2"]) {
  cypherQueryV2(query: $cypherQuery, params: $params) {
   edges {
    node {
     columns {
      key
      value {. on GraphStoreCypherQueryV2NodeList {
        nodes {
         data {. on ExternalPosition {
           id
          }
         }
        }
       }. on GraphStoreCypherQueryV2AriNode {
        data {. on ExternalPosition {
          id
         }
        }
       }. on GraphStoreCypherQueryV2BooleanObject {
        bool_val: value
       }. on GraphStoreCypherQueryV2IntObject {
        int_val: value
       }. on GraphStoreCypherQueryV2FloatObject {
        float_val: value
       }. on GraphStoreCypherQueryV2StringObject {
        str_val: value
       }
      }
     }
    }
   }
  }
 }
}
Params
1
2
{
 "cypherQuery": "MATCH (user:IdentityUser {ari: $id})-[:user_has_external_position]->(position:ExternalPosition) RETURN position",
 "params": {
  "id": "$id"
 }
}

Inverse query

GraphQL
1
2
query UserHasExternalPosition_CypherQuery($cypherQuery: String!, $params: JSON!) {
 graphStore @optIn(to: ["GraphStore", "GraphStoreCypherQueryV2"]) {
  cypherQueryV2(query: $cypherQuery, params: $params) {
   edges {
    node {
     columns {
      key
      value {. on GraphStoreCypherQueryV2NodeList {
        nodes {
         data {. on AtlassianAccountUser {
           id
          }. on CustomerUser {
           id
          }. on AppUser {
           id
          }
         }
        }
       }. on GraphStoreCypherQueryV2AriNode {
        data {. on AtlassianAccountUser {
          id
         }. on CustomerUser {
          id
         }. on AppUser {
          id
         }
        }
       }. on GraphStoreCypherQueryV2BooleanObject {
        bool_val: value
       }. on GraphStoreCypherQueryV2IntObject {
        int_val: value
       }. on GraphStoreCypherQueryV2FloatObject {
        float_val: value
       }. on GraphStoreCypherQueryV2StringObject {
        str_val: value
       }
      }
     }
    }
   }
  }
 }
}
Params
1
2
{
 "cypherQuery": "MATCH (user:IdentityUser)-[:user_has_external_position]->(position:ExternalPosition {ari: $id}) RETURN user",
 "params": {
  "id": "$id"
 }
}

Materialization via Cypher Experimental

This materialization rule automatically creates user_has_external_position relationships by traversing from Identity users through external workers to find associated external positions. The traversal follows this relationship structure (maxDepth: 3):

  • external-worker-conflates-to-user (depth: 3)
    • external-worker-conflates-to-identity-3p-user (depth: 1)
    • user-linked-third-party-user (depth: 2)
      • user-linked-via-3lo-third-party-user (depth: 1)
      • user-linked-via-admin-import-third-party-user (depth: 1)
      • user-linked-via-email-third-party-user (depth: 1)
  • external-position-is-filled-by-external-worker (depth: 1)

Cypher

1
2
// Materialization Rule: external-worker-associates-user-to-position
MATCH (user:IdentityUser {ari: $id})
MATCH (user)<-[rel0:external_worker_conflates_to_user]-(worker:ExternalWorker)
MATCH (worker)<-[rel1:external_position_is_filled_by_external_worker]-(position:ExternalPosition)
RETURN position AS ret, GREATEST(MAX(rel0.lastUpdated), MAX(rel1.lastUpdated)) AS lastUpdated

Rate this page: