Skip to content

Commit

Permalink
Merge pull request #130 JIR-28
Browse files Browse the repository at this point in the history
* Fix to CSV change file type
* Added backup endpoint
  • Loading branch information
princenyeche authored Apr 1, 2024
2 parents 97e1ae7 + 5b0e134 commit 45ad278
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Jira one change log

**Release 0.8.3** - 2024-04-01
* Fixing the CSV change file type and merge_files to run without JQL
* Added a new endpoint to `runbackup`


**Release 0.8.2** - 2024-01-02
* Minor fix to `process_executor` function with invalid arguments

Expand Down
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ Below shows the list of supported versions for the jiraone library

| Version | Supported |
|---------|--------------------|
| 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 | :white_check_mark: |
| 0.7.6 | :white_check_mark: |
| 0.7.5 | :white_check_mark: |
| 0.7.5 | :x: |
| 0.7.4 | :x: |
| 0.7.3 | :x: |
| 0.7.2 | :x: |
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "jiraone"
version = "v0.8.2"
version = "v0.8.3"
authors = [
{ name="Prince Nyeche", email="support@elfapp.website" },
]
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.2"
__version__ = "0.8.3"
__all__ = [
"LOGIN",
"endpoint",
Expand Down
12 changes: 12 additions & 0 deletions src/jiraone/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -3906,6 +3906,18 @@ def project_validate(cls, key_or_name: str, check: str = None) -> str:
". See jiraone docs for more info.",
)

@classmethod
def runbackup(cls):
"""Runs a backup process for the environment
Example 1::
# send a POST request with the payload
payload_data = {"cbAttachments": "false", "exportToCloud": "true"}
# changing "cbAttachments" to "true" will enable backup with attachments
"""
return "{}/rest/backup/1/export/runbackup".format(LOGIN.base_url)


class For:
"""A Class to show the implementation of a 'for' loop.
Expand Down
34 changes: 28 additions & 6 deletions src/jiraone/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -3270,6 +3270,22 @@ def export_issues(
# stores most configuration data using a dictionary
config = {}

if merge_files:
jql = ""
if csv_to_json:
jql = ""
extension = "json"
if check_auth is False:
sys.stderr.write("Warning: A valid session to query Jira data"
" is required when using the `csv_to_json` "
"argument.")

if merge_files and csv_to_json:
raise JiraOneErrors("errors",
"You cannot use both "
"`merge_files` and `csv_to_json` at the same"
" time as both are mutually exclusive.")

# Checking that the arguments are passing correct data structure.
def field_value_check(
param_field: list = None,
Expand Down Expand Up @@ -3431,6 +3447,7 @@ def map_field(
"single string character.",
)
elif delimit == "":
delimit = ","
print(
"Defaulting to comma as CSV separator."
) if extension.lower() == "csv" else None
Expand Down Expand Up @@ -3860,6 +3877,7 @@ def check_field_membership(
0,
0,
)

if csv_to_json != "":
merge_files.append(csv_to_json)

Expand Down Expand Up @@ -5266,7 +5284,8 @@ def csv_field_change(
if operation == "exclude" or operation == "include"
else "Changing CSV file delimiter"
)
fetch_field_ids(config["headers"])
if operation == "exclude" or operation == "include":
fetch_field_ids(config["headers"])
(
_field_list,
first_run,
Expand Down Expand Up @@ -5305,7 +5324,7 @@ def csv_field_change(
_field_data.append(field_row)
if first_run is False:
file_headers.append(
field_header.get("field_column_name")
field_header.get("column_name")
)

first_run = True
Expand All @@ -5324,8 +5343,6 @@ def csv_field_change(
mark="many",
mode="w+",
delimiter=delimit
if operation == "exclude" or operation == "include"
else ",",
)
)
print(
Expand All @@ -5344,8 +5361,6 @@ def csv_field_change(
data=_field_list,
mark="many",
delimiter=delimit
if operation == "exclude" or operation == "include"
else ",",
)
)

Expand Down Expand Up @@ -7326,6 +7341,13 @@ def issue_count(
return DotNotation(value)


@staticmethod
def view_issues(*,
project_key_or_id: Union[str, int] = None,
key_or_id: Union[str, int] = None) -> None:
"""View all issues and its properties"""


class Users:
"""
This class helps to Generate the No of Users on Jira Cloud
Expand Down

0 comments on commit 45ad278

Please # to comment.