Code Monkey home page Code Monkey logo

jiraone's People

Contributors

princenyeche avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jiraone's Issues

Error trying to import to json (Jira Data Center)

Hello Support,
I am trying to export json file on Jira DC. I got this issue:

Exception in thread Thread-4 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-1 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-5 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-13 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
Exception in thread Thread-12 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-14 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-16 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-18 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
Exception in thread Thread-17 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-20 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-21 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-15 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-22 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-23 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-24 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-19 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-25 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
Exception in thread Thread-26 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
"key": a["key"],
KeyError: 'key'
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-27 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
Exception in thread Thread-28 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-30 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-29 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-33 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-35 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-34 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-36 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3673, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3606, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-31 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-32 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3688, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3598, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-38 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/jiraone/reporting.py", line 3673, in float_fields
map_name = field.get_field(
File "/usr/local/lib/python3.10/dist-packages/jiraone/access.py", line 3606, in get_field
"key": a["key"],
KeyError: 'key'
Exception in thread Thread-37 (float_fields):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()

For CSV no issues. All good.

Code

LOGIN.api = False
fields = []
jql = "project in (XPN) order by created DESC"
issue_export(jql=jql, extension="json", fields=fields)

Thanks and regards,
Sergio

field_name: Target a field name to render. datatype -> string

Dear Reader,
Are you able to provide an example for the use of field_name please.
I have assigned field_name=”Summary” but every time I assign this variable a value and run the script then I get nothing in the CSV.
If I exclude the field_name then all is as expected. PROJECT.change_log(jql=jql, folder=folder, file=file, show_output=show_output, field_name=field_name) is what I am using.
I have tried using caps and all lowercase and tried also issue.summary, have tried other field names too. I am at a lost, thank you

Authentication with bearer token

Hello Prince,

the autentication doesnt work with the bearer token. In our company we can only retrieve data over a login with bearer token.
Can you help us with the autentication?

Thanks & best regards
Smari

Jiraone delta extraction

Hello!

I have been using the jiraone python module to extract the historic information of issues.
Example code from docs:

from jiraone import LOGIN, PROJECT

user = "email"
password = "token"
link = https://yourinstance.atlassian.net/
LOGIN(user=user, password=password, url=link)

if name == 'main':

jql = "project in (PYT) ORDER BY Rank DESC"  
PROJECT.change_log(jql=jql)

Its great except everytime I run it, it extracts from the beginning which takes a long time. I was wondering if it was possible to extract just the delta/updates not the whole of the information.

Thanks!

How to export issues with needed feilds only?

Hi,

I am trying to use this jiraone module to export issues to CSV using "export_issues" in this module.
This gives me export of all fields. How to export only 5 fields which I need?

Thnx.

connection broken during the export

I got this issue after 20 minutes with no result for page 3

<Response [200]> ::downloading issues at page: 0 of 12
<Response [200]> ::downloading issues at page: 1 of 12
<Response [200]> ::downloading issues at page: 2 of 12

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 685, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 685, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 425, in _error_catcher
yield
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 752, in read_chunked
self._update_chunk_length()
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 689, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/models.py", line 750, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 560, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 781, in read_chunked
self._original_response.close()
File "/usr/lib/python3.8/contextlib.py", line 131, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python3/dist-packages/urllib3/response.py", line 443, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "exportcsvfulldwp_7.py", line 19, in
issue_export(jql=jql, extension="csv", fields=fields, final_file="/scripts/Python/backup7"+d1)
File "/home/sleondelarosa/.local/lib/python3.8/site-packages/jiraone/reporting.py", line 4006, in export_issues
download_csv() if not merge_files else config.update(
File "/home/sleondelarosa/.local/lib/python3.8/site-packages/jiraone/reporting.py", line 3968, in download_csv
LOGIN.get(
File "/home/sleondelarosa/.local/lib/python3.8/site-packages/jiraone/access.py", line 418, in get
response = requests.get(
File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 535, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 688, in send
r.content
File "/usr/lib/python3/dist-packages/requests/models.py", line 828, in content
self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
File "/usr/lib/python3/dist-packages/requests/models.py", line 753, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

Any idea I got sometimes this issue?

Thanks and regards,
Sergio

CSV error

Hello,

Environment : JIRA Datacenter, jiraone 0.8.1

When trying to export a lot of issues ( about 5000) with issue_export function, I get this error message:

File "C:\Program Files\Python312\Lib\site-packages\jiraone\reporting.py", line 4696, in export_issues
merging_files() # loop through each file and attempt combination
^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\jiraone\reporting.py", line 4656, in merging_files
file_reader(
File "C:\Program Files\Python312\Lib\site-packages\jiraone\reporting.py", line 7932, in file_reader
load = [d for d in read]
^^^^^^^^^^^^^^^^^
_csv.Error: field larger than field limit (131072)

It seems that a field exceeded the limit. Is there a way to increase this limit ? Or is there a way to not merge the CSV temp files in a single file at the end of process?

Thank you.

UnicodeEncodeError: 'charmap' codec can't encode character '\x95' in position 1114: character maps to <undefined>

Hi @princenyeche,

I recently reported a bug when downloading incident history via Python on the Atlassian forum.
https://community.atlassian.com/t5/Jira-articles/Extracting-complete-issue-history-via-API/ba-p/1659204

The error is this: UnicodeEncodeError: 'charmap' codec can't encode character '\x95' in position 1114: character maps to

As you said create a ticket through this way so I ask for your support to be able to resolve it.
Thank you very much

Problem with Export parameters for field_types

Having an issue with attempting to produce an export with only a limited number of fields. (using v 0.7.5). If I update to 0.7.6 or higher than I run in to this issue - #119

Here is part of my script with various different attempts

jql = f"a valid JQL query in here"

  • Get page count

issue = PROJECT.issue_count(jql)
count_issue = issue.count
page_count = issue.max_page
print("Total number of issues - " + str(count_issue) + "")
print("Number of pages required - " + str(page_count) + "")

  • Different Export options

  • Attempt to export using UI "My Defaults"
    PROJECT.export_issues(jql=jql, field_type="current", page=(0, page_count), final_file=export_file)

  • Attempt to export with a limited set of included files
    includes = ["Summary", "Visa Products Impacted", "Created"]
    PROJECT.export_issues(jql=jql, include_fields=includes, page=(0, page_count), final_file=export_file)

  • Direct call to issue_export class
    issue_export(jql=jql, field_type="current", page=(0, page_count), final_file=export_file)

All of these give the same result - the export runs fine but it always includes ALL fields and never the subset that I need. It feels like it is just ignoring/not honoring the field_type or include_fields parameters.

Anything else you can suggest I can do here or how to debug/troubleshoot ?

issue_export stuck

Context : JIRA Datacenter version
jiraone 0.7.9

It seems that there is a regression in issue_export feature. With jiraone 0.7.8, issue_export is running fine with fields option set to []

But with jiraone 0.7.9:

With fields option, set to [], the process is stuck. The export directory is created. Inside it, I can find a temp csv file (temp_file_0.csv) which seems complete. The output is:

Defaulting to comma as CSV separator.
Downloading issue export in CSV format.
<Response [200]> ::downloading issues at page: 0 of 0

Without fields option, set to [], I get error :

Traceback (most recent call last):
File "D:\Tools\Strawberry\scripts\ExportTicketsToCSV2.py", line 25, in
issue_export(jql=jql_tech_task, folder=Export_Folder,final_file="Defect.csv")
File "C:\Program Files\Python312\Lib\site-packages\jiraone\reporting.py", line 3296, in export_issues
field_value_check(field_names) # We'll always check this
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\jiraone\reporting.py", line 3278, in field_value_check
raise JiraOneErrors(
jiraone.exceptions.JiraOneErrors: <JiraOneError: Unable to find initial field, probably such field "Assignee" doesn't exist for fields argument>

Issue with Retrieving Full Project History Using Jiraone REST API

Hello,

I am currently utilizing the Jiraone REST API for extracting project history, which has been incredibly useful. However, I'm encountering a limitation with projects that contain extensive data. Specifically, I'm only able to retrieve history data up until last year, and not all details are being pulled.

Below is the Python script I'm using. I'm exploring whether there's a way to fetch the complete history, or, if data volume is an issue, to selectively specify certain fields within the history to retrieve all relevant changes. Alternatively, could I implement a date range to segment the output into manageable chunks? Another possibility I'm considering is whether there's an alternative to using PROJECT.change_log for this purpose.

I appreciate any guidance you can provide, as I'm relatively new to both Jira and Python.

from jiraone import LOGIN, PROJECT

# User credentials and Jira instance URL
user = "my_email"
password = "my_Token"
link = "My_DC_URL"

# Log into the Jira instance
LOGIN.api = False
LOGIN(user=user, password=password, url=link)

# Main execution
if __name__ == '__main__':
    # the output of the file would be relative to the directory where this python file is executed
    jql = "issuekey in (ID-54145)"  # A valid JQL query
    PROJECT.change_log(jql=jql)

Thanks for your assistance,

Aamir

Linked issues

Hi Prince.

I wanted know if with Jiraone we can obtain a report that shows us all the Linked issues to all the issues of a project.

image

I have tried several options, but I don't get anything favorable. Do you know if with Jiraone I can get a report similar to the following?

image

Is there a possibility that something can be implemented in jiraone to get this report?

I hope you can help me, I will be very grateful.

I await your comments.

Best regards.

issue_export failing

Context : JIRA datacenter v9.8.1, python 3.12

When running issue_export(query=jql) , I get following error:

Exception in thread Thread-4 (map_field):
Traceback (most recent call last):
Traceback (most recent call last):
  File "C:\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
  File "C:\Users\212544016\Box Sync\Scripts\JIRA migration\Build.GE\NewExtract\BAVEU\test2.py", line 34, in <module>
    self.run()
  File "C:\Python312\Lib\threading.py", line 1010, in run
    issue_export(query=jql)
  File "C:\Python312\Lib\site-packages\jiraone\reporting.py", line 2454, in export_issues
    self._target(*self._args, **self._kwargs)
  File "C:\Python312\Lib\site-packages\jiraone\reporting.py", line 2415, in map_field
    field_value_check(_field_names_)  # We'll always check this
    mapper = field.get_field(fname)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\jiraone\reporting.py", line 2439, in field_value_check
  File "C:\Python312\Lib\site-packages\jiraone\access.py", line 3598, in get_field
    raise JiraOneErrors(
    "key": a["key"],
jiraone.exceptions.JiraOneErrors: <JiraOneError: Unable to find initial field, probably such field "Sprint,Watchers,Reporter,Assignee" doesn't exist for fields argument>
           ~^^^^^^^
KeyError: 'key'

Could you please help?

Question about issue_export

Hello,

Comma is used as a CSV delimiter. Is there a way to choose another character as delimiter? I didn't find anything in the documentation.

Thank you.

JSON export

thanks for the contributions

I been trying to export in JSON but it always get's stuck at the same point
here is the script

from jiraone import LOGIN, issue_export
import json

file = "C:\Users\ [path]\config.json"
config = json.load(open(file))
LOGIN(**config)

jql = 'project in (project1, project2) and created >= "2023/10/23 00:00" AND created <= "2023/10/23 23:59" ORDER BY Updated DESC'

properties = ["users", "history"]

issue_export(jql=jql, extension="json", json_properties=properties)

it gets stuck here
Converting Jira custom field names to Jira JSON compatible names.
Verifying users and group membership

Is there way to bypass the group membership ? with CSV it downloads all the required info

Thanks in advance

Private CA certificates / OAuth login

I am just trying out JiraOne to see if I can use it, connecting to a Jira Datacenter air-gapped installation for a client, and they have their own CA with certificates signed by that CA, but which JiraOne considers as self-signed and refuses to go further. Thus I’m stuck at the first step. I’ve had a look at the documentation, but can see no mention of certificates.

I’ve also followed Atlassian’s instructions to create an Application Link (generating an RSA key pair and supplying the key to Jira to create the application link) to use OAuth 1.0a, but don’t see how to use it with JiraOne or if it is possible.

I’d be grateful if you could advise me at all? Many thanks :-)

Issue using download_attachments

I have been using your fantastic JIRAONE library for a migration project for some of our JIRA projects to a new instance.
I am having issues trying to get the code working correctly for downloading attachments locally. I am sure it is just that I don’t understand your documentation properly:

https://jiraone.readthedocs.io/en/latest/apis.html#project
staticdownload_attachments

My script looks like this :

from jiraone import LOGIN, PROJECT
from threading import Thread
LOGIN.api = False
user = "xxx"
password = "xxxx
link = xxxxx
LOGIN(user=user, password=password, url=link)
#file = "conf.json"
#config = json.load(open(file))
#LOGIN(**config)
project = 'DPLSCE'
print ("Downloading attachments for Project - "+ project + "")
if name == 'main':
the output of the file would be absolute to the directory where this python file is being executed from
jql = f"project = {project}"
the below method, helps you download a report of a list of files per issue on a project or on projects
Thread(target=PROJECT.get_attachments_on_projects(query=jql)).start()
afterwards, you can use the below method to move attachments across instances without downloading it
if you're using your own file structure say a csv file, you need to identify the index of the attachment
for this, 3 keyword args are used key=0, attach=1, and file=2 -> all requires an integer value.
PROJECT.move_attachments_across_instances(attach_file="new.csv", key=0, attach=1, file=2)
To download an attachment locally use
PROJECT.download_attachments(download_path="C:\Temp\Download", attach=1, file=2)

But this throws the error:

Traceback (most recent call last):
File "C:\Temp\Python\jira-attachment-download.py", line 34, in
PROJECT.download_attachments(download_path="C:\Temp\Download", attach=1, file=2)
File "C:\Program Files\Python39\lib\site-packages\jiraone\reporting.py", line 753, in download_attachments
read = file_reader(folder=file_folder, file_name=file_name, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\jiraone\reporting.py", line 3267, in file_reader
file = path_builder(path=folder, file_name=file_name)
File "C:\Program Files\Python39\lib\site-packages\jiraone\reporting.py", line 3150, in path_builder
base_dir = os.path.join(WORK_PATH, path)
File "C:\Program Files\Python39\lib\ntpath.py", line 117, in join
genericpath._check_arg_types('join', path, *paths)
File "C:\Program Files\Python39\lib\genericpath.py", line 152, in _check_arg_types
raise TypeError(f'{funcname}() argument must be str, bytes, or '
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'NoneType'

I am unable to work out what I need to adjust to make this run successfully and would love you help to understand what I need to do. The PROJECT.get_attachments_on_projects runs successfully.

issue_export page size parameter needed

Hello, First, thanks a lot for this lib !
Are you still supporting it ?
Is there any way to change the page size for the issue_export method ?
I have some instances so large that the "default max" (1k isses per page) will crash, especially in cloud:

Downloading issue export in CSV format.
<Response [200]> OK ::downloading issues at page: 0 of 4
<Response [200]> OK ::downloading issues at page: 1 of 4
<Response [200]> OK ::downloading issues at page: 2 of 4
<Response [504]> Gateway Timeout ::downloading issues at page: 3 of 4
<Response [200]> OK ::downloading issues at page: 4 of 4

=> results in a crash in the merge (1 file containing the CSV error...)

Thank you in advance !

Error executing time_in_status

Getting an error when executing time_in_status.
config = json.load(open('config.json'))
LOGIN(**config)
key = {"jql": "Sprint = 1892 order by created DESC"}
temp = time_in_status(PROJECT, key, file_reader, pprint=True, is_printable=True,
output_format="json", report_folder="STATUSPAGE", report_file="time.json",
login=LOGIN, output_filename="result")

Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1483, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/Ce/PycharmProjects/StatusTime/main.py", line 20, in
temp = time_in_status(PROJECT, key, file_reader, pprint=True, is_printable=True,
File "C:\Users\Ce.virtualenvs\StatusTime-ViV0hHXO\lib\site-packages\jiraone\module.py", line 168, in time_in_status
items = data_dog.make(histories)
File "c:\program files\python39\lib\collections_init
.py", line 441, in _make
raise TypeError(f'Expected {num_fields} arguments, got {len(result)}')
TypeError: Expected 13 arguments, got 0
python-BaseException

Export in .RST an project, issue

Dear @princenyeche

I am looking to generate an .rst file including attachments and pictures for my issue reporting.

  • summary of
    • worklog
    • status
    • for each issue, the details including embedded pictures, attachments

Today, exporting in word is not enough and embedded pictures not included

image

Any idea the way to go ?

Best Regards

from: can't read /var/mail/jiraone

When I attempt to run from jiraone import LOGIN, USER and then add my information I am getting an error:

from: can't read /var/mail/jiraone
zsh: command not found: user
zsh: command not found: password
link: =: No such file or directory
zsh: unknown username 'er=u'

I found a bug in the class PROJECT.change_log

Discussed in #100

Originally posted by NomadSU October 13, 2022
Hi
First of all, I have to admit that your product is good.
I found one error in PROJECT.change_log class
In the reporting.py file, on line 1061, you are trying to delete the "iter_saves.json" file, but this cannot be done because the file is already in use.
Well I found out why
On line 129 you open the file but then don't close it
i added os.close(fd) and now everything works for me

How-to: Using Jira api token to log in

have been trying to get this working in python, but have not been able to work out how to login using email address and API token (created from Jira personal profile) ?

I have tried the below and it gives me:

Traceback (most recent call last):
File "E:\Downloads\from jiraone import LOGIN.py", line 12, in
PROJECT.change_log(jql=jql)
File "C:\Users\msm\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\jiraone\reporting.py", line 827, in change_log
raise JiraOneErrors("login", "Authentication failed. Please check your credentials.")
jiraone.exceptions.JiraOneErrors: <JiraOneError: Authentication failed. Please check your credentials.>

from jiraone import LOGIN, PROJECT

user = ""
password = ""
link = ""
LOGIN(user=user, password=password, url=link)

if name == 'main':
# the output of the file would be absolute to the directory where this python file is being executed from
jql = "project in (PYT) ORDER BY Rank DESC" # A valid JQL query
PROJECT.change_log(jql=jql)

_csv.Error: field larger than field limit (131072)

Hello support
I got this issue:
<Response [200]> ::downloading issues at page: 3 of 3
Processing. Current progress: 25%
Processing. Current progress: 50%
Processing. Current progress: 75%
Traceback (most recent call last):
File "exportcsvfullxypoc_3.py", line 14, in
issue_export(jql=jql, extension="csv", fields=fields, final_file="/scripts/Python/backup"+d1, page=(0,3))
File "/home/sleondelarosa/.local/lib/python3.8/site-packages/jiraone/reporting.py", line 4696, in export_issues
merging_files() # loop through each file and attempt combination
File "/home/sleondelarosa/.local/lib/python3.8/site-packages/jiraone/reporting.py", line 4656, in merging_files
file_reader(
File "/home/sleondelarosa/.local/lib/python3.8/site-packages/jiraone/reporting.py", line 7932, in file_reader
load = [d for d in read]
File "/home/sleondelarosa/.local/lib/python3.8/site-packages/jiraone/reporting.py", line 7932, in
load = [d for d in read]
_csv.Error: field larger than field limit (131072)

Is it possible to extend the field limit?
Version jiraone 0.8.2
Thanks and regards,
Sergio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.