Skip to content

Commit b5f9f80

Browse files
prakharcodePrakhar Srivastava
andauthored
feat: Added a new child stream IssueChangelog (#40)
Co-authored-by: Prakhar Srivastava <prakhar.srivastava@Tiqets-NLLP0388.local>
1 parent f92945b commit b5f9f80

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

tap_jira/streams.py

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2992,7 +2992,7 @@ def get_url_params(
29922992
next_page_token: Any | None,
29932993
) -> dict[str, Any]:
29942994
params: dict = {}
2995-
2995+
29962996
params["jql"] = [] # init a query param
29972997

29982998
if next_page_token:
@@ -3015,7 +3015,7 @@ def get_url_params(
30153015
params["jql"] = jql
30163016

30173017
else:
3018-
params.pop("jql") # drop if there's no query
3018+
params.pop("jql") # drop if there's no query
30193019

30203020
return params
30213021

@@ -4254,3 +4254,53 @@ class WorkflowSearchStream(JiraStream):
42544254
Property("created", StringType),
42554255
Property("updated", StringType),
42564256
).to_dict()
4257+
4258+
4259+
class IssueChangeLogStream(JiraStream):
4260+
4261+
"""
4262+
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflow-get
4263+
"""
4264+
4265+
"""
4266+
name: stream name
4267+
path: path which will be added to api url in client.py
4268+
schema: instream schema
4269+
primary_keys = primary keys for the table
4270+
replication_key = datetime keys for replication
4271+
records_jsonpath = json response body
4272+
"""
4273+
4274+
name = "issue_changelog"
4275+
4276+
parent_stream_type = IssueStream
4277+
4278+
ignore_parent_replication_keys = True
4279+
4280+
path = "/issue/{issue_id}/changelog"
4281+
4282+
primary_keys = ["id"]
4283+
4284+
records_jsonpath = "$[values][*]"
4285+
4286+
instance_name = "values"
4287+
4288+
schema = PropertiesList(
4289+
Property("id", StringType),
4290+
Property("author", ObjectType(Property("accountId", StringType))),
4291+
Property("created", DateTimeType),
4292+
Property(
4293+
"items",
4294+
ArrayType(
4295+
ObjectType(
4296+
Property("field", StringType),
4297+
Property("fieldtype", StringType),
4298+
Property("fieldId", StringType),
4299+
Property("from", StringType),
4300+
Property("fromString", StringType),
4301+
Property("to", StringType),
4302+
Property("toString", StringType),
4303+
)
4304+
),
4305+
),
4306+
).to_dict()

tap_jira/tap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def discover_streams(self) -> list[streams.JiraStream]:
8181
streams.StatusesSearchStream(self),
8282
streams.WorkflowStream(self),
8383
streams.WorkflowSearchStream(self),
84+
streams.IssueChangeLogStream(self),
8485
]
8586

8687

0 commit comments

Comments
 (0)