Skip to content

Commit

Permalink
JIR-24 JIR-23 version 0.7.9
Browse files Browse the repository at this point in the history
* Project updates
* Fixes, improvements and deprecations
  • Loading branch information
princenyeche authored Dec 23, 2023
2 parents ddc29dc + 8133ca0 commit 7f1aab9
Show file tree
Hide file tree
Showing 25 changed files with 7,133 additions and 2,946 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
dist: xenial
dist: jammy
language: python
python:
- "3.7"
- "3.8"
cache: pip
before_install:
- python -m pip install --upgrade pip
install:
- pip install -r requirements.txt
- python -m pip install jiraone requests
script:
- python test.py
88 changes: 54 additions & 34 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
# Jira one change log

**Release 0.7.9** - 2023-12-23
### Minor update #115
* Update to `time_in_status` function to include timestamp in UTC
* Update to `issue_export` method for better performance and caching
* Fix to `field` class in Server/DC Jira preventing key error
* Added to `async_change_log` method which now supports multiprocessing and/or threading
```python
# import statement
PROJECT.async_change_log(
jql, folder="TEST", file="sample.csv", flush=10
)
```

* Added new methods to `endpoint` alias for issuetype scheme, security scheme etc
* Added tests for all the major functions/methods for CI/CD process
* Added requirement for Python 3.8.x and above to run jiraone
* Removed deprecated method `get_attachment_meta_data` from `endpoint` constant as this has been active for more than 2 years.
* Removed duplicated URL link in code for `task`, `issue_watchers`, and `issue_votes` method in `endpoint` constant.


**Release 0.7.8** - 2023-07-04
### Minor update #112
### Minor update #113
* Fix to management API for organization management.


Expand All @@ -15,7 +35,7 @@
* It is now possible to perform export in JSON format
* Added field exclusion and inclusion in CSV format export
* Added new methods `get_project_versions` and `issue_link_types` to access.py module
* Added a `process_executor` function, regular express constants and a `DateFormat` class to
* Added a `process_executor` function, regular express constants and a `DateFormat` class to
the utils module of jiraone.
* Added examples in the documentation

Expand All @@ -39,10 +59,10 @@ the utils module of jiraone.
* Patch to file descriptor error in windows machine. Thanks to [@NomadSU](https://github.com/NomadSU)
* Patch to file_writer encoding. This will help to prevent any encoding errors that might happen due to non utf-8 encoding use cases.
* Added a new method `LOGIN.from_jira()` which takes an instance of the `jira` object from the python jira package.
* This allows the ability to access jira's object methods, classes and properties. Making it possible to combine both
* This allows the ability to access jira's object methods, classes and properties. Making it possible to combine both
jiraone's and jira's packages as one. Please note this will only work with basic authentication as of now!

Example:
Example:
```python
from jira import JIRA
from jiraone import LOGIN, endpoint
Expand Down Expand Up @@ -160,8 +180,8 @@ os.environ["JIRAONE_OAUTH"] = f"{dumps}"
LOGIN(oauth=client)
# LOGIN.save_oauth is a property value, always available
# after an OAuth session is initialized
json.dump(LOGIN.save_oauth,
open(file, encoding="utf-8", mode="w+"),
json.dump(LOGIN.save_oauth,
open(file, encoding="utf-8", mode="w+"),
indent=4)
print(LOGIN.get(endpoint.myself()).json())

Expand Down Expand Up @@ -210,7 +230,7 @@ print(dot.name)


**Release 0.5.7** - 2022-02-21
### Update
### Update
* Added a new function `delete_attachments()` that can perform deletion of attachments with filtering.
* Provided a checkpoint in the iteration of the above function, so it can start from the last known point.
* Corrected some docs in `access.py` module
Expand All @@ -220,8 +240,8 @@ print(dot.name)
**Release 0.5.6** - 2022-02-02
### Patch update #73
* Patch v5 to `time_in_status()`. Noticed that the statuses time were wrong. There seems to be
a change in the way the previous API payload was retrieved. Tweaked the logic for retrieving
accurate difference in time.
a change in the way the previous API payload was retrieved. Tweaked the logic for retrieving
accurate difference in time.
* The statuses and their time can now be retrieved accurately.
* The save check_point is turned off for the `time_in_status()` function as a slight logic needs
to be added to account for when a breakpoint happens between checkpoint to retain
Expand Down Expand Up @@ -254,31 +274,31 @@ be written to the file.


**Release 0.5.0** - 2022-01-04
### Micro update #65
### Micro update #65
* Corrected URL for codacy on `README.md` file.


**Release 0.4.9** - 2022-01-04
### Micro update #64
### Micro update #64
* Updated the repo project URL
* Updated name on MIT License #63
* Updated name on MIT License #63


**Release 0.4.8** - 2021-12-20
### Micro update #62
### Micro update #62
* Added new methods to endpoint API.


**Release 0.4.7** - 2021-10-24
### Micro update #60
### Micro update #60
* Added two other methods to manage api. `get_all_users` and `find_user`.
* The former returns all the users in the organization and the later finds a specific user based on displayname, accountId or email address


**Release 0.4.6** - 2021-10-11
### Micro update #57
### Micro update #57

* Added two new functions used by organization users such as `bulk_change_email` and `bulk_change_swap_email` in the `jiraone.module`. It makes use of the organization API that was released in #54
* Added two new functions used by organization users such as `bulk_change_email` and `bulk_change_swap_email` in the `jiraone.module`. It makes use of the organization API that was released in #54

For example
```python
Expand All @@ -295,12 +315,12 @@ bulk_change_email(file, token)
```

**Release 0.4.5** - 2021-10-10
### Micro update #55
* Made a patch on #55
### Micro update #55
* Made a patch on #55


**Release 0.4.4** - 2021-10-09
### Micro update #54
### Micro update #54
* Added new organization and user management REST API
* You can be able to create and manage organization users. See more details [here](https://princenyeche.github.io/atlassian-cloud-api/api#manage)
Example
Expand All @@ -319,8 +339,8 @@ manage.manage_user(account_id, json=payload) # By default it is set to disable a
```

**Release 0.4.3** - 2021-09-23
### Micro update #53
* Added a new function in `jiraone.module` which you can use as below. The helps to generate a report of the`time in status` of Jira issues. You can create an output file either in CSV or JSON format. #53
### Micro update #53
* Added a new function in `jiraone.module` which you can use as below. The helps to generate a report of the`time in status` of Jira issues. You can create an output file either in CSV or JSON format. #53
_Example usage_
```python
from jiraone import LOGIN, PROJECT, file_reader
Expand All @@ -339,38 +359,38 @@ if __name__ == "__main__":
```

**Release 0.4.2** - 2021-08-31
### Micro update #52
### Micro update #52
* Made patch to v0.4.1 from #51 due to key error when using on server instance.


**Release 0.4.1** - 2021-08-30
### Micro update #51
* Patch to v0.4.0 about the bug reported on #47
### Micro update #51
* Patch to v0.4.0 about the bug reported on #47


**Release 0.4.0** - 2021-08-29
### #49 Minor update
* Fixed problem associated with `None` value reported on #47
* Fixed problem associated with `None` value reported on #47
* Fixed some minor issues with `field_update` from `jira.module`
* Added access to `user` and `password` attribute with `LOGIN` variable. Now you can do
* `LOGIN.user` and `LOGIN.password` to get a call to those attributes.


**Release 0.3.9** - 2021-08-1
### Micro update #45
### Micro update #45
- Patch and removal of print statement in `field.cascading`.


**Release 0.3.8** - 2021-08-1
### Micro update #43
### Micro update #43
- Patch to `USER.search_user` unable to find some users
- Apparently increasing the **maxResult** from 50 to 100 caused this unknown behaviour. Reverted back to 50.
- Patch to `field.search_field` unable to find some custom fields.
- Apparently increasing the **maxResult** from 50 to 100 caused this unknown behaviour. Reverted back to 50.


**Release 0.3.7** - 2021-08-1
## v0.3.7 #42
## v0.3.7 #42
- Added exceptions class `exceptions.py`
- Created a new module for fields
- A new function `field_update` from the module file to handle most field updates.
Expand All @@ -379,7 +399,7 @@ if __name__ == "__main__":
```python
from jiraone import field, echo, module
#...previous login statements
# first parameter is the field class alias, 2nd param is an issue key, 3rd a Jira field and
# first parameter is the field class alias, 2nd param is an issue key, 3rd a Jira field and
# 4th the data value you want to update or change
key = 'T6-73'
field_name = 'A Cascading field'
Expand All @@ -404,7 +424,7 @@ echo(value)
### #38 Micro update
* Added two more attributes to the comment(key).comment() method
* `first_comment` -> returns the first comment in the body content. Can only be called when "body" option is called on the type_field else returns "None".

* `last_comment` -> returns the last comment in the body content. Can only be called when "body" option is called on the type_field else returns "None".
**Example usage**:

Expand Down Expand Up @@ -463,10 +483,10 @@ text = """
comment(key, method="post", text_block=text, placer="<user>", mention=USER.mention_user(name), event=True)
```

The name of users separated by comma, will be changed dynamically within the method. Using the `event=True` argument enables the comment endpoint to switch to post. See more from the `endpoint` methods. As you can see, for any place in the text string where I used
The name of users separated by comma, will be changed dynamically within the method. Using the `event=True` argument enables the comment endpoint to switch to post. See more from the `endpoint` methods. As you can see, for any place in the text string where I used
***< user >*** that will be replaced to a mentioned format for cloud e.g. [~accountId:5584xxxxxx]



**Release 0.3.1** - 2021-04-10
### #36 Fix bug
Expand Down Expand Up @@ -724,7 +744,7 @@ if __name__ == '__main__':


**Release 0.1.2** - 2021-01-05
### Micro update #5
### Micro update #5
Micro updates
* Corrected Docstrings

Expand Down
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/86f1594e0ac3406aa9609c4cd7c70642)](https://www.codacy.com/gh/princenyeche/jiraone/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=princenyeche/jiraone&amp;utm_campaign=Badge_Grade)
[![Downloads](https://pepy.tech/badge/jiraone)](https://pepy.tech/project/jiraone)
[![Downloads](https://static.pepy.tech/badge/jiraone)](https://pepy.tech/project/jiraone)
[![PyPI version](https://badge.fury.io/py/jiraone.svg)](https://badge.fury.io/py/jiraone)
![PyPI - License](https://img.shields.io/pypi/l/jiraone)
![Build Doc](https://readthedocs.org/projects/jiraone/badge/?version=latest)
Expand All @@ -8,13 +8,13 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)


# Jira one
# jiraone
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 in order to utilize this script.
* Download python and install 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
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.
* 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
pip install jiraone
```
Expand All @@ -24,14 +24,11 @@ python3 -m pip install jiraone
```

## Classes, functions and methods
Jiraone comes with various classes, functions and methods. Aliases as well, are used to represent
links to classes and functions. The major ones to take note of are the ones shown on the directory link below.
jiraone comes with various classes, functions and methods. Aliases as well, are used to represent links to classes and functions. The major ones to take note of are the ones shown on the directory link below.

For further knowledge on how to use the classes, methods or functions. Open the jiraone package and read the docstring on the
aforementioned methods or functions above to get further information.
If you would like more information on how to use the classes, methods or functions. Open the jiraone package and read the docstring on the aforementioned methods or functions to get further information.

If you're connecting to Jira server or datacenter, you will need to change the API endpoint to point to server instances. To do that, simply change
the attribute `LOGIN.api = False` this helps to use the endpoint `/rest/api/latest` which is compatible for Jira server or datacenter.
If you're connecting to a Jira server or data centre, you must change the API endpoint to point to server instances. To do that, change the attribute `LOGIN.api = False` this helps to use the endpoint `/rest/api/latest` which is compatible with Jira server or datacenter.

```python
from jiraone import LOGIN
Expand All @@ -41,7 +38,7 @@ LOGIN.api = False
LOGIN(*data)
```

The above login method applies only when you need to access a Jira server or datacenter type instances. The above has little or no effect on cloud instance and will work normally.
The above login method applies only when you need to access a Jira server or datacenter type instances. The above has little or no effect on cloud instances and will work normally.

# Directory
* [Using the API](https://jiraone.readthedocs.io/en/latest/api.html)
Expand Down
7 changes: 4 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ Below shows the list of supported versions for the jiraone library

| Version | Supported |
|---------|--------------------|
| 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.4 | :white_check_mark: |
| 0.7.3 | :x: |
| 0.7.4 | :x: |
| 0.7.3 | :x: |
| 0.7.2 | :x: |
| 0.7.1 | :x: |
| 0.7.0 | :x: |
Expand All @@ -27,4 +28,4 @@ Below shows the list of supported versions for the jiraone library

## Reporting a Vulnerability

Please for any security related issue. Send us an email at [email protected]
Please for any security related issue, email to [email protected]
Loading

0 comments on commit 7f1aab9

Please sign in to comment.