Skip to content

Source Jira: Add Board, Epic, and Sprint-related streams and improve request caching #6621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0296c39
Create separate cache file per stream and add projects and start_date…
cjwooo Sep 30, 2021
2dd2391
Add project id to issue record
cjwooo Sep 30, 2021
7e162bd
Add projectId to issue schema
cjwooo Sep 30, 2021
73b9094
Add BoardIssues stream
cjwooo Sep 30, 2021
5817354
Add SprintIssues stream
cjwooo Sep 30, 2021
b7104f5
Add Epics stream and deduplicate state code
cjwooo Oct 1, 2021
f0d1588
Add EpicIssues stream and additional fields for Issues stream
cjwooo Oct 1, 2021
767e3fd
Add story points to sprint issues
cjwooo Oct 1, 2021
945a28f
Add new streams to test catalog
cjwooo Oct 1, 2021
c25b629
Update gitignore
cjwooo Oct 1, 2021
520b4dc
Rename cache boolean and fix test catalog
cjwooo Oct 1, 2021
a4476c0
Fix streams that depend on Issues stream
cjwooo Oct 5, 2021
fbfbd01
Merge branch 'master' into cwu/jira2
cjwooo Oct 6, 2021
09bd3ea
Fix sprint_issues stream
cjwooo Oct 7, 2021
252733b
Add more fields to issues stream and format
cjwooo Oct 7, 2021
5ced0ce
Add option to expand issue changelogs
cjwooo Oct 7, 2021
390d8bb
Remove epic_issues stream
cjwooo Oct 7, 2021
852a0df
Expand project descriptions
cjwooo Oct 8, 2021
da9b4c9
Show rendered fields for epics
cjwooo Oct 8, 2021
1e00ce4
Include project key
cjwooo Oct 8, 2021
64f30b5
Include project key in issues stream
cjwooo Oct 11, 2021
3672409
Merge branch 'master' into cwu/jira2
cjwooo Oct 14, 2021
f58559a
Address comments
cjwooo Oct 14, 2021
fa14746
Use CDK caching
cjwooo Oct 14, 2021
7f71d5b
Remove extra changes
cjwooo Oct 14, 2021
2b34aa4
Fix sprints stream reading from non-scrum boards
cjwooo Oct 14, 2021
2dc8a20
Format
cjwooo Oct 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "board_issues",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_cursor": false
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "dashboards",
Expand All @@ -40,6 +50,16 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "epics",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_cursor": false
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "filters",
Expand Down Expand Up @@ -160,6 +180,16 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "sprint_issues",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_cursor": false
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "time_tracking",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"api_token": "invalid_token",
"domain": "invaliddomain.atlassian.net",
"email": "[email protected]"
"email": "[email protected]",
"projects": ["invalidproject"],
"start_date": "2021-09-25T00:00:00Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"expand": {
"type": "string"
},
"id": {
"type": "string"
},
"self": {
"type": "string"
},
"key": {
"type": "string"
},
"fields": {
"type": "object"
},
"boardId": {
"type": "string"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
},
"projectId": {
"type": "string"
},
"projectKey": {
"type": "string"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"expand": {
"type": "string",
"description": "Expand options that include additional issue details in the response.",
"readOnly": true,
"xml": {
"attribute": true
}
},
"id": {
"type": "string",
"description": "The ID of the epic.",
"readOnly": true
},
"self": {
"type": "string",
"description": "The URL of the epic details.",
"format": "uri",
"readOnly": true
},
"key": {
"type": "string",
"description": "The key of the epic.",
"readOnly": true
},
"fields": {
"type": "object",
"properties": {
"summary": {
"type": ["string", "null"],
"description": "Epic summary"
},
"description": {
"type": ["string", "null"],
"description": "Epic description"
},
"status": {
"type": ["string", "object"],
"description": "Epic status"
},
"updated": {
"type": ["string", "null"],
"format": "date-time",
"description": "This field is not shown in schema / swagger, but exists in records and we use it as cursor fiekd."
}
},
"additionalProperties": {}
},
"projectId": {
"type": "string",
"description": "The ID of the project containing the epic.",
"readOnly": true
},
"projectKey": {
"type": "string",
"description": "The key of the project containing the epic.",
"readOnly": true
}
},
"additionalProperties": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@
}
},
"additionalProperties": {}
},
"projectId": {
"type": "string",
"description": "The ID of the project containing the issue.",
"readOnly": true
},
"projectKey": {
"type": "string",
"description": "The key of the project containing the issue.",
"readOnly": true
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"expand": {
"type": "string"
},
"id": {
"type": "string"
},
"self": {
"type": "string"
},
"key": {
"type": "string"
},
"fields": {
"type": "object"
},
"sprintId": {
"type": "number"
}
}
}
27 changes: 19 additions & 8 deletions airbyte-integrations/connectors/source-jira/source_jira/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
from .streams import (
ApplicationRoles,
Avatars,
BoardIssues,
Boards,
Dashboards,
Epics,
Filters,
FilterSharing,
Groups,
Expand Down Expand Up @@ -54,6 +56,7 @@
ScreenSchemes,
ScreenTabFields,
ScreenTabs,
SprintIssues,
Sprints,
TimeTracking,
Users,
Expand Down Expand Up @@ -96,33 +99,40 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) ->

def streams(self, config: Mapping[str, Any]) -> List[Stream]:
authenticator = self.get_authenticator(config)
args = {"authenticator": authenticator, "domain": config["domain"]}
args = {"authenticator": authenticator, "domain": config["domain"], "projects": config["projects"]}
incremental_args = {**args, "start_date": config["start_date"]}
return [
ApplicationRoles(**args),
Avatars(**args),
Boards(**args),
BoardIssues(**incremental_args),
Dashboards(**args),
Epics(**incremental_args),
Filters(**args),
FilterSharing(**args),
Groups(**args),
Issues(**args),
IssueComments(**args),
Issues(
**incremental_args,
additional_fields=config.get("additional_fields", []),
expand_changelog=config.get("expand_issue_changelog", False)
),
IssueComments(**incremental_args),
IssueFields(**args),
IssueFieldConfigurations(**args),
IssueCustomFieldContexts(**args),
IssueLinkTypes(**args),
IssueNavigatorSettings(**args),
IssueNotificationSchemes(**args),
IssuePriorities(**args),
IssueProperties(**args),
IssueRemoteLinks(**args),
IssueProperties(**incremental_args),
IssueRemoteLinks(**incremental_args),
IssueResolutions(**args),
IssueSecuritySchemes(**args),
IssueTypeSchemes(**args),
IssueTypeScreenSchemes(**args),
IssueVotes(**args),
IssueWatchers(**args),
IssueWorklogs(**args),
IssueVotes(**incremental_args),
IssueWatchers(**incremental_args),
IssueWorklogs(**incremental_args),
JiraSettings(**args),
Labels(**args),
Permissions(**args),
Expand All @@ -140,6 +150,7 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]:
ScreenTabFields(**args),
ScreenSchemes(**args),
Sprints(**args),
SprintIssues(**incremental_args),
TimeTracking(**args),
Users(**args),
Workflows(**args),
Expand Down
35 changes: 33 additions & 2 deletions airbyte-integrations/connectors/source-jira/source_jira/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Jira Spec",
"type": "object",
"required": ["api_token", "domain", "email"],
"additionalProperties": false,
"required": ["api_token", "domain", "email", "projects", "start_date"],
"additionalProperties": true,
"properties": {
"api_token": {
"type": "string",
Expand All @@ -21,6 +21,37 @@
"email": {
"type": "string",
"description": "The user email for your Jira account"
},
"projects": {
"type": "array",
"title": "Projects",
"items": {
"type": "string"
},
"examples": ["PROJ1", "PROJ2"],
"description": "Comma-separated list of Jira project keys to replicate data for"
},
"start_date": {
"type": "string",
"title": "Start Date",
"description": "The date from which you'd like to replicate data for Jira in the format YYYY-MM-DDT00:00:00Z. All data generated after this date will be replicated. Note that it will be used only in the following incremental streams: issues.",
"examples": ["2021-03-01T00:00:00Z"],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
},
"additional_fields": {
"type": "array",
"title": "Additional Fields",
"items": {
"type": "string"
},
"description": "Comma-separated list of additional fields to include in replicating issues",
"examples": ["Field A", "Field B"]
},
"expand_issue_changelog": {
"type": "boolean",
"title": "Expand Issue Changelog",
"description": "Expand the changelog when replicating issues",
"default": false
}
}
}
Expand Down
Loading