Skip to content

Commit

Permalink
NoneType error with JSON export JIR-31
Browse files Browse the repository at this point in the history
NoneType error with JSON export
  • Loading branch information
princenyeche authored Dec 30, 2024
2 parents 9eff695 + fec7515 commit 6ae8481
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 48 deletions.
10 changes: 9 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Jira one change log

**Release 0.8.6** - 2024-12-31

Fixes:
- 🐛 An issue with JSON export that causes `None` type error which triggers an exception during extraction.

Updates:
- Made an update to the attributes in `Permissions` to align with the built-in Jira project and global permission module on cloud.

**Release 0.8.5** - 2024-06-26

Fixes:
Expand All @@ -19,7 +27,7 @@ Fixes:
- 🐛 `json_field_builder`: check if `sprint_custom_id` is None
- 🐛 `path_builder`: handle multi-dir base_dir
- 🐛 `download_attachments`: avoid conflicts/overwrites by isolating attachments (helps with https://github.com/princenyeche/jiraone/issues/112)

Improvements:
-`download_attachments`: make defaults and behaviour match `get_attachments_on_projects`

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
A REST API Implementation to Jira Cloud APIs for creating reports and for performing other Jira queries.

## Configurations
Install using `pip`. You have to be on Python >= 3.6.x to utilize this script. From version 0.7.9 will require Python 3.8.x and above.
Install using `pip`. You have to be on Python >= 3.6.x to utilize this script. From version 0.8.6 will require Python 3.9.x and above.
* Download Python and install it on your device by visiting [python.org](https://python.org/downloads)
* Run the below command either using a virtual environment or from your Python alias
```bash
Expand Down
11 changes: 6 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ Below is the list of supported versions for the jiraone library

| Version | Supported |
|---------|--------------------|
| 0.8.6 | :white_check_mark: |
| 0.8.5 | :white_check_mark: |
| 0.8.4 | :white_check_mark: |
| 0.8.3 | :white_check_mark: |
| 0.8.2 | :white_check_mark: |
| 0.8.1 | :white_check_mark: |
| 0.7.9 | :white_check_mark: |
| 0.7.8 | :white_check_mark: |
| 0.7.7 | :x: |
| 0.7.6 | :x: |
| 0.7.5 | :x: |
| 0.7.9 | :x: |
| 0.7.8 | :x: |
| 0.7.7 | :x: |
| 0.7.6 | :x: |
| 0.7.5 | :x: |
| 0.7.4 | :x: |
| 0.7.3 | :x: |
| 0.7.2 | :x: |
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "jiraone"
version = "v0.8.5"
version = "v0.8.6"
authors = [
{ name="Prince Nyeche", email="[email protected]" },
]
Expand All @@ -10,7 +10,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = [
"requests",
]
Expand Down
2 changes: 1 addition & 1 deletion src/jiraone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from jiraone.management import manage

__author__ = "Prince Nyeche"
__version__ = "0.8.5"
__version__ = "0.8.6"
__all__ = [
"LOGIN",
"endpoint",
Expand Down
50 changes: 25 additions & 25 deletions src/jiraone/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@ class Permissions:
"""A constant of Jira permission scheme attributes."""

ASSIGNABLE_USER = "ASSIGNABLE_USER"
ASSIGN_ISSUE = "ASSIGN_ISSUE"
ATTACHMENT_DELETE_ALL = "ATTACHMENT_DELETE_ALL"
ATTACHMENT_DELETE_OWN = "ATTACHMENT_DELETE_OWN"
BROWSE = "BROWSE"
CLOSE_ISSUE = "CLOSE_ISSUE"
COMMENT_DELETE_ALL = "COMMENT_DELETE_ALL"
COMMENT_DELETE_OWN = "COMMENT_DELETE_OWN"
COMMENT_EDIT_ALL = "COMMENT_EDIT_ALL"
COMMENT_EDIT_OWN = "COMMENT_EDIT_OWN"
COMMENT_ISSUE = "COMMENT_ISSUE"
CREATE_ATTACHMENT = "CREATE_ATTACHMENT"
CREATE_ISSUE = "CREATE_ISSUE"
DELETE_ISSUE = "DELETE_ISSUE"
EDIT_ISSUE = "EDIT_ISSUE"
LINK_ISSUE = "LINK_ISSUE"
MANAGE_WATCHER_LIST = "MANAGE_WATCHER_LIST"
ASSIGN_ISSUES = "ASSIGN_ISSUES"
DELETE_ALL_ATTACHMENTS = "DELETE_ALL_ATTACHMENTS"
DELETE_OWN_ATTACHMENTS = "DELETE_OWN_ATTACHMENTS"
BROWSE_PROJECTS = "BROWSE_PROJECTS"
CLOSE_ISSUES = "CLOSE_ISSUES"
DELETE_ALL_COMMENTS = "DELETE_ALL_COMMENTS"
DELETE_OWN_COMMENTS = "DELETE_OWN_COMMENTS"
EDIT_ALL_COMMENTS = "EDIT_ALL_COMMENTS"
EDIT_OWN_COMMENTS = "EDIT_OWN_COMMENTS"
ADD_COMMENTS = "ADD_COMMENTS"
CREATE_ATTACHMENTS = "CREATE_ATTACHMENTS"
CREATE_ISSUES = "CREATE_ISSUES"
DELETE_ISSUES = "DELETE_ISSUES"
EDIT_ISSUES = "EDIT_ISSUES"
LINK_ISSUES = "LINK_ISSUES"
MANAGE_WATCHERS = "MANAGE_WATCHERS"
MODIFY_REPORTER = "MODIFY_REPORTER"
MOVE_ISSUE = "MOVE_ISSUE"
MOVE_ISSUES = "MOVE_ISSUES"
PROJECT_ADMIN = "PROJECT_ADMIN"
RESOLVE_ISSUE = "RESOLVE_ISSUE"
SCHEDULE_ISSUE = "SCHEDULE_ISSUE"
RESOLVE_ISSUES = "RESOLVE_ISSUES"
SCHEDULE_ISSUES = "SCHEDULE_ISSUES"
SET_ISSUE_SECURITY = "SET_ISSUE_SECURITY"
TRANSITION_ISSUE = "TRANSITION_ISSUE"
TRANSITION_ISSUES = "TRANSITION_ISSUES"
VIEW_VERSION_CONTROL = "VIEW_VERSION_CONTROL"
VIEW_VOTERS_AND_WATCHERS = "VIEW_VOTERS_AND_WATCHERS"
VIEW_WORKFLOW_READONLY = "VIEW_WORKFLOW_READONLY"
WORKLOG_DELETE_ALL = "WORKLOG_DELETE_ALL"
WORKLOG_DELETE_OWN = "WORKLOG_DELETE_OWN"
WORKLOG_EDIT_ALL = "WORKLOG_EDIT_ALL"
WORKLOG_EDIT_OWN = "WORKLOG_EDIT_OWN"
WORK_ISSUE = "WORK_ISSUE"
DELETE_ALL_WORKLOGS = "DELETE_ALL_WORKLOGS"
DELETE_OWN_WORKLOGS = "DELETE_OWN_WORKLOGS"
EDIT_ALL_WORKLOGS = "EDIT_ALL_WORKLOGS"
EDIT_OWN_WORKLOGS = "EDIT_OWN_WORKLOGS"
WORK_ON_ISSUES = "WORK_ON_ISSUES"


def field_update(
Expand Down
26 changes: 13 additions & 13 deletions src/jiraone/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6626,11 +6626,11 @@ def sprint_extract(
# values
# Below are the conditions for arranging field
# values
if not obj_name.get("column_name").startswith(
if not obj_name.get("column_name", "").startswith(
"custom"
):
if (
obj_name.get("column_name")
obj_name.get("column_name", "")
.lower()
.startswith("comment")
):
Expand Down Expand Up @@ -6663,7 +6663,7 @@ def sprint_extract(
].append(_data)

elif (
obj_name.get("column_name")
obj_name.get("column_name", "")
.lower()
.startswith("attachment")
):
Expand All @@ -6678,7 +6678,7 @@ def sprint_extract(
json_attachment_template[
"attachments"
].append(_data)
elif obj_name.get("column_name").startswith(
elif obj_name.get("column_name", "").startswith(
"worklog"
):
worklog = obj_value.split(";")
Expand All @@ -6696,7 +6696,7 @@ def sprint_extract(
"worklogs"
].append(_data)

elif obj_name.get("column_name").startswith(
elif obj_name.get("column_name", "").startswith(
"labels"
):
if obj_value == "" or obj_value is None:
Expand All @@ -6706,7 +6706,7 @@ def sprint_extract(
obj_value
)

elif obj_name.get("column_name").startswith(
elif obj_name.get("column_name", "").startswith(
"Inward issue link"
):
if obj_value == "" or obj_value is None:
Expand All @@ -6727,7 +6727,7 @@ def sprint_extract(
],
}
)
elif obj_name.get("column_name").startswith(
elif obj_name.get("column_name", "").startswith(
"Outward issue link"
):
if obj_value == "" or obj_value is None:
Expand All @@ -6748,7 +6748,7 @@ def sprint_extract(
],
}
)
elif obj_name.get("column_name").startswith(
elif obj_name.get("column_name", "").startswith(
"Watchers Id"
if LOGIN.api is True
else "Watchers"
Expand All @@ -6759,7 +6759,7 @@ def sprint_extract(
json_watchers_template[
"watchers"
].append(obj_value)
elif obj_name.get("column_name").startswith(
elif obj_name.get("column_name", "").startswith(
"components"
):
if obj_value == "" or obj_value is None:
Expand All @@ -6768,7 +6768,7 @@ def sprint_extract(
json_component_template[
"components"
].append(obj_value)
elif obj_name.get("column_name").startswith(
elif obj_name.get("column_name", "").startswith(
"fixVersions"
):
if obj_value == "" or obj_value is None:
Expand All @@ -6777,7 +6777,7 @@ def sprint_extract(
json_fixversion_template[
"fixedVersions"
].append(obj_value)
elif obj_name.get("column_name").startswith(
elif obj_name.get("column_name", "").startswith(
"affectedVersions"
):
if obj_value == "" or obj_value is None:
Expand All @@ -6786,12 +6786,12 @@ def sprint_extract(
json_affectversion_template[
"affectedVersions"
].append(obj_value)
elif obj_name.get("column_name").startswith(
elif obj_name.get("column_name", "").startswith(
"Issue id"
):
issue_id = obj_value
issue_data.update({"externalId": issue_id})
elif obj_name.get("column_name").startswith(
elif obj_name.get("column_name", "").startswith(
"Sprint"
):
if obj_value == "" or obj_value is None:
Expand Down

0 comments on commit 6ae8481

Please sign in to comment.