From ce2f03889ab2c380499e2bd6c3db0ae810062e72 Mon Sep 17 00:00:00 2001 From: Richard Gao Date: Wed, 6 Sep 2023 09:48:05 -0600 Subject: [PATCH 1/7] Add `Workspace` and `Asset` entities --- jira.sgnl.yaml | 108 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/jira.sgnl.yaml b/jira.sgnl.yaml index c8725c0..67856ea 100644 --- a/jira.sgnl.yaml +++ b/jira.sgnl.yaml @@ -383,6 +383,109 @@ entities: type: String indexed: true + Workspace: + # https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-assets/#api-rest-servicedeskapi-assets-workspace-get. + displayName: JiraWorkspace + externalId: Workspace + description: Workspace entity in Jira + syncFrequency: HOURLY + syncMinInterval: 1 + apiCallFrequency: SECONDLY + apiCallMinInterval: 1 + pageSize: 100 + pagesOrderedById: false + attributes: + - name: workspaceId + externalId: workspaceId + type: String + indexed: true + uniqueId: true + + Asset: + # https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-aql-post. + displayName: JiraAsset + externalId: Asset + description: Asset entity in Jira + syncFrequency: HOURLY + syncMinInterval: 1 + apiCallFrequency: SECONDLY + apiCallMinInterval: 1 + pageSize: 100 + pagesOrderedById: false + attributes: + - name: globalId + externalId: globalId + type: String + indexed: true + uniqueId: true + - name: workspaceId + externalId: workspaceId + type: String + indexed: true + - name: id + externalId: id + type: String + - name: label + externalId: label + type: String + - name: objectKey + externalId: objectKey + type: String + - name: objectType__workspaceId + externalId: objectType__workspaceId + type: String + - name: objectType__globalId + externalId: objectType__globalId + type: String + - name: objectType__id + externalId: objectType__id + type: String + - name: objectType__name + externalId: objectType__name + type: String + - name: objectType__description + externalId: objectType__description + type: String + - name: objectType__position + externalId: objectType__position + type: Int64 + - name: objectType__created + externalId: objectType__created + type: DateTime + - name: objectType__updated + externalId: objectType__updated + type: DateTime + - name: objectType__objectCount + externalId: objectType__objectCount + type: Int64 + - name: objectType__objectSchemaId + externalId: objectType__objectSchemaId + type: String + - name: objectType__inherited + externalId: objectType__inherited + type: Bool + - name: objectType__abstractObjectType + externalId: objectType__abstractObjectType + type: Bool + - name: objectType__parentObjectTypeInherited + externalId: objectType__parentObjectTypeInherited + type: Bool + - name: created + externalId: created + type: DateTime + - name: updated + externalId: updated + type: DateTime + - name: timestamp + externalId: timestamp + type: Int64 + - name: _links__self + externalId: _links__self + type: String + - name: name + externalId: name + type: String + relationships: # (User) -[UserMember]-> (GroupMember) UserMember: @@ -403,6 +506,11 @@ relationships: direction: Forward - relationship: GroupMember direction: Forward + # (Asset) -[AssetMember]-> (Workspace) + AssetMember: + name: AssetMember + fromAttribute: Asset.workspaceId + toAttribute: Workspace.workspaceId # (Issue) -[AssignedTo]-> (User) IssueAssignee: name: AssignedTo From 4763d4ae251316512a2ccf1c0060df1c13d3d764 Mon Sep 17 00:00:00 2001 From: Richard Gao Date: Thu, 7 Sep 2023 08:13:28 -0600 Subject: [PATCH 2/7] Rename `Asset` to `Object` --- jira.sgnl.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/jira.sgnl.yaml b/jira.sgnl.yaml index 67856ea..9cfd67a 100644 --- a/jira.sgnl.yaml +++ b/jira.sgnl.yaml @@ -401,11 +401,11 @@ entities: indexed: true uniqueId: true - Asset: + Object: # https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-aql-post. - displayName: JiraAsset - externalId: Asset - description: Asset entity in Jira + displayName: JiraObject + externalId: Object + description: Object entity in Jira syncFrequency: HOURLY syncMinInterval: 1 apiCallFrequency: SECONDLY @@ -506,10 +506,10 @@ relationships: direction: Forward - relationship: GroupMember direction: Forward - # (Asset) -[AssetMember]-> (Workspace) - AssetMember: - name: AssetMember - fromAttribute: Asset.workspaceId + # (Object) -[ObjectMember]-> (Workspace) + ObjectMember: + name: ObjectMember + fromAttribute: Object.workspaceId toAttribute: Workspace.workspaceId # (Issue) -[AssignedTo]-> (User) IssueAssignee: From 97194990ee0b77b5e2d22db49391477455ddf21e Mon Sep 17 00:00:00 2001 From: Richard Gao Date: Fri, 8 Sep 2023 10:53:35 -0600 Subject: [PATCH 3/7] Comment out `_links__self` attribute --- jira.sgnl.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jira.sgnl.yaml b/jira.sgnl.yaml index 9cfd67a..d6e44b4 100644 --- a/jira.sgnl.yaml +++ b/jira.sgnl.yaml @@ -479,9 +479,10 @@ entities: - name: timestamp externalId: timestamp type: Int64 - - name: _links__self - externalId: _links__self - type: String + # TODO: We currently don't allow attributes to be start with a non-alphanumeric char. + # - name: _links__self + # externalId: _links__self + # type: String - name: name externalId: name type: String From dd55f5b6a00d81e831a758c3442950d2bc36bdaf Mon Sep 17 00:00:00 2001 From: Richard Gao Date: Fri, 8 Sep 2023 11:05:29 -0600 Subject: [PATCH 4/7] Add example for objects ql query --- jira.sgnl.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/jira.sgnl.yaml b/jira.sgnl.yaml index d6e44b4..5ee436c 100644 --- a/jira.sgnl.yaml +++ b/jira.sgnl.yaml @@ -12,6 +12,7 @@ type: "Jira-1.0.0" # empty config: {} | b64: "e30=" # config with issues jql filter: {"issuesJqlFilter":"project=SGNL"} | b64: "eyJpc3N1ZXNKcWxGaWx0ZXIiOiJwcm9qZWN0PVNHTkwifQ==" # config with issues jql filter with space {"issuesJqlFilter":"project='Customer Support'"} | b64: "eyJpc3N1ZXNKcWxGaWx0ZXIiOiJwcm9qZWN0PSdDdXN0b21lciBTdXBwb3J0JyJ9" +# config with objects ql query {"objectsQlQuery":"objectType = Customer"} | b64: "eyJvYmplY3RzUWxRdWVyeSI6Im9iamVjdFR5cGUgPSBDdXN0b21lciJ9" adapterConfig: "e30=" # This must match the list of supportedAuthMechanisms specified on the Adapter. auth: From c3b3863b18521b1a889367a888625166fb6852a3 Mon Sep 17 00:00:00 2001 From: Richard Gao Date: Fri, 8 Sep 2023 11:16:06 -0600 Subject: [PATCH 5/7] Add warning to Objects --- jira.sgnl.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jira.sgnl.yaml b/jira.sgnl.yaml index 5ee436c..9df9c53 100644 --- a/jira.sgnl.yaml +++ b/jira.sgnl.yaml @@ -402,6 +402,8 @@ entities: indexed: true uniqueId: true + # WARNING: In order to sync Objects, you must specify the objectsQlQuery in the adapterConfig. + # otherwise Jira will return 400. Object: # https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-aql-post. displayName: JiraObject From c8332ec8e21b2d3c35d7d9e588c256a06e4a4165 Mon Sep 17 00:00:00 2001 From: Richard Gao Date: Fri, 8 Sep 2023 11:50:37 -0600 Subject: [PATCH 6/7] Remove unsupported attribute --- jira.sgnl.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/jira.sgnl.yaml b/jira.sgnl.yaml index 9df9c53..f3f0bec 100644 --- a/jira.sgnl.yaml +++ b/jira.sgnl.yaml @@ -482,10 +482,6 @@ entities: - name: timestamp externalId: timestamp type: Int64 - # TODO: We currently don't allow attributes to be start with a non-alphanumeric char. - # - name: _links__self - # externalId: _links__self - # type: String - name: name externalId: name type: String From 94207516d34de86c8750b64c250a518ec3a0c2ef Mon Sep 17 00:00:00 2001 From: Richard Gao Date: Fri, 8 Sep 2023 13:29:27 -0600 Subject: [PATCH 7/7] Update default adapter config --- jira.sgnl.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jira.sgnl.yaml b/jira.sgnl.yaml index f3f0bec..f20273f 100644 --- a/jira.sgnl.yaml +++ b/jira.sgnl.yaml @@ -13,7 +13,7 @@ type: "Jira-1.0.0" # config with issues jql filter: {"issuesJqlFilter":"project=SGNL"} | b64: "eyJpc3N1ZXNKcWxGaWx0ZXIiOiJwcm9qZWN0PVNHTkwifQ==" # config with issues jql filter with space {"issuesJqlFilter":"project='Customer Support'"} | b64: "eyJpc3N1ZXNKcWxGaWx0ZXIiOiJwcm9qZWN0PSdDdXN0b21lciBTdXBwb3J0JyJ9" # config with objects ql query {"objectsQlQuery":"objectType = Customer"} | b64: "eyJvYmplY3RzUWxRdWVyeSI6Im9iamVjdFR5cGUgPSBDdXN0b21lciJ9" -adapterConfig: "e30=" +adapterConfig: "eyJvYmplY3RzUWxRdWVyeSI6Im9iamVjdFR5cGUgPSBJTlBVVF9SRVFVSVJFRCJ9" # {"objectsQlQuery":"objectType = INPUT_REQUIRED"} # This must match the list of supportedAuthMechanisms specified on the Adapter. auth: - basic: