Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue_export failing #119

Closed
alpesmaritimes34170 opened this issue Dec 14, 2023 · 5 comments
Closed

issue_export failing #119

alpesmaritimes34170 opened this issue Dec 14, 2023 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@alpesmaritimes34170
Copy link

alpesmaritimes34170 commented Dec 14, 2023

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?

@princenyeche princenyeche self-assigned this Dec 17, 2023
@princenyeche princenyeche added the question Further information is requested label Dec 17, 2023
@JoeGT
Copy link

JoeGT commented Dec 19, 2023

Adding here that I am also getting this same error and that I can reproduce this with literally any set of parameters - I am unable to get ANY exports to run successfully on this version.

@princenyeche
Copy link
Owner

@alpesmaritimes34170 It appears there is a problem related to an absent key in the Field class method get_field. In the DC environment, the key object seems not to be present for certain fields, and it should simply route to the name or id. However, this situation is not handled appropriately in the jiraone code. I have addressed this issue in version 0.7.9, which I plan to release this week. Before the update, I aimed to address additional issues that had been brought to my attention. I'll update this later. However, you could try adding an empty list to the fields argument so it doesn't check these fields.

# import statement
fields = []
jql = ...
issue_export(jql=jql, fields=fields)

@JoeGT
Copy link

JoeGT commented Dec 19, 2023

That resolved the issue for me @princenyeche. In fact not only did it resolve the issues using 0.7.8 but it also solved the problem I was having with getting the default fields for my exports noted in #120

Thank you

@alpesmaritimes34170
Copy link
Author

It works for me also with this workaround. Thank you.

@princenyeche
Copy link
Owner

the fix is out on #115.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants