Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #64 from JupiterOne/INT-11509
Browse files Browse the repository at this point in the history
Duplicated key for the user. Remove metadata from incidents
  • Loading branch information
Gonzalo-Avalos-Ribas authored Aug 28, 2024
2 parents 49665cf + 8386954 commit 7a4a7fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export const Entities = {
_type: 'service_now_incident',
_class: 'Incident',
disableClassMatch: true,
indexMetadata: {
enabled: false,
},
},
CMDB_OBJECT: {
resourceName: 'CMDB Object',
Expand Down
6 changes: 5 additions & 1 deletion src/steps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export async function fetchUsers(
return;
}
await client.iterateUsers(async (user) => {
const userEntity = await jobState.addEntity(createUserEntity(user));
const userEntity = createUserEntity(user);
if (jobState.hasKey(userEntity._key)) {
return;
}
await jobState.addEntity(userEntity);

await jobState.addRelationship(
createDirectRelationship({
Expand Down

0 comments on commit 7a4a7fe

Please sign in to comment.