Skip to content

Commit dc2cbd0

Browse files
authored
Jira source connector: add status filter and option to download attachments to issues (#616)
1 parent 59e7c74 commit dc2cbd0

File tree

7 files changed

+47
-17
lines changed

7 files changed

+47
-17
lines changed

snippets/general-shared-text/jira-api-placeholders.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
- `<project-id>`: The ID of a target project in Jira to access.
77
- `<board-id>`: The ID of a target board in Jira to access.
88
- `<issue-id>`: The ID of a target issue in Jira to access.
9-
- Set `cloud` to `true` to specify using Jira Cloud or `false` to specify using Jira Data Center. The default is to use Jira Data Center.
9+
- `<status>`: The name of a status to filter Jira issues by.
10+
- Set `download_attachments` to `true` to download attachments from Jira issues. The default is `false`.
11+
- Set `cloud` to `true` to specify using Jira Cloud or `false` to specify using Jira Data Center. The default is to use Jira Data Center.

snippets/general-shared-text/jira-cli-api.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@ Also, to process specific projects, boards, or issues, use:
3232
- `--projects` with a comma-delimited list of target project IDs (CLI) or `project` with an array of target project IDs (Python).
3333
- `--boards` with a comma-delmited list of target board IDs (CLI) or `boards` with an array of target board IDs (Python).
3434
- `--issues` with a comma-delimited list of target issue IDs (CLI) or `issues` with an array of target issue IDs (Python).
35+
- `--status-filter` with a comma-delimited list of statuses to filter Jira issues by (CLI) or `status_filter` with an array of statuses to filter Jira issues by (Python).
36+
- `--download-attachments` (CLI) or `download_attachments=True` (Python) to download attachments from Jira issues.
37+
- `--no-download-attachments` (CLI) or `download_attachments=False` (Python) to not download attachments from Jira issues. This is the default behavior.
3538
- `--cloud` (CLI) or `cloud=True` (Python) to specify using Jira Cloud. The default is to use Jira Data Center.
36-
- `--no-cloud` (CLI) or `cloud=False` (Python) to specify using Jira Data Center. This is the default behavior.
39+
- `--no-cloud` (CLI) or `cloud=False` (Python) to specify using Jira Data Center. This is the default behavior.

snippets/general-shared-text/jira-platform.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ Fill in the following fields:
99
- **Cloud**: Check this box if you are using Jira Cloud. The default is unchecked to use Jira Data Center.
1010
- **Projects**: A comma-separated list of IDs of the target projects in Jira to access.
1111
- **Boards**: A comma-separated list of IDs of the target boards in Jira to access.
12-
- **Issues**: A comma-separated list of IDs of the target issues in Jira to access.
12+
- **Issues**: A comma-separated list of IDs of the target issues in Jira to access.
13+
- **Status Filter**: A comma-separated list of statuses to filter Jira issues by.
14+
- **Issues**: A comma-separated list of IDs of the target issues in Jira to access.
15+
- **Download Attachments**: If checked, download attachments from Jira issues. By default, attachments are not downloaded.

snippets/source_connectors/jira.sh.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ unstructured-ingest \
1212
--cloud \ # For Jira Cloud.
1313
--no-cloud \ # For Jira Data Center (default).
1414
--output-dir $LOCAL_FILE_OUTPUT_DIR \
15+
--projects <project-id>,<project-id> \
16+
--boards <board-id>,<board-id> \
17+
--issues <issue-id>,<issue-id> \
18+
--status-filters <status>,<status> \
19+
--download-attachments \
1520
--chunking-strategy by_title \
1621
--embedding-provider huggingface \
1722
--partition-by-api \

snippets/source_connectors/jira.v2.py.mdx

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,31 @@ if __name__ == "__main__":
2020
Pipeline.from_configs(
2121
context=ProcessorConfig(),
2222
indexer_config=JiraIndexerConfig(
23-
# projects=[
24-
# "project-id",
25-
# "project-id"
26-
# ],
27-
# boards=[
28-
# "board-id",
29-
# "board-id"
30-
# ],
31-
# issues=[
32-
# "issue-id",
33-
# "issue-id"
34-
# ]
23+
projects=[
24+
"<project-id>",
25+
"<project-id>"
26+
],
27+
boards=[
28+
"<board-id>",
29+
"<board-id>"
30+
],
31+
issues=[
32+
"<issue-id>",
33+
"<issue-id>"
34+
],
35+
status_filter=[
36+
"<status>",
37+
"<status>"
38+
]
39+
),
40+
downloader_config=JiraDownloaderConfig(
41+
download_dir=os.getenv("LOCAL_FILE_DOWNLOAD_DIR"),
42+
download_attachments=True
3543
),
36-
downloader_config=JiraDownloaderConfig(download_dir=os.getenv("LOCAL_FILE_DOWNLOAD_DIR")),
3744
source_connection_config=JiraConnectionConfig(
3845
access_config=JiraAccessConfig(
3946
password=os.getenv("JIRA_PASSWORD_OR_API_TOKEN"), # Password or API token authentication.
40-
# token=os.getenv("JIRA_PERSONAL_ACCES_TOKEN") # Personal access token authentication only.
47+
# token=os.getenv("JIRA_PERSONAL_ACCESS_TOKEN") # Personal access token authentication only.
4148
),
4249
url=os.getenv("JIRA_URL"),
4350
username=os.getenv("JIRA_USERNAME"), # For password or API token authentication.

snippets/source_connectors/jira_rest_create.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ curl --request 'POST' --location \
3030
"<issue-id>",
3131
"<issue-id>"
3232
],
33+
"status_filters": [
34+
"<status>",
35+
"<status>"
36+
],
37+
"download_attachments": <true|false>,
3338
"cloud": <true|false>
3439
}
3540
}'

snippets/source_connectors/jira_sdk.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ with UnstructuredClient(api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")) as clien
3737
"<issue-id>",
3838
"<issue-id>"
3939
],
40+
status_filters=[
41+
"<status>",
42+
"<status>"
43+
],
44+
download_attachments=<True|False>,
4045
cloud=<True|False>
4146
)
4247
)

0 commit comments

Comments
 (0)