-
Notifications
You must be signed in to change notification settings - Fork 10
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
Exception when using SubIssueType picklist #78
Comments
If we can get the picklist mitigated in the main repo that would be great. If not this may be a fork off of to fix. |
I've clearly written this part of the lookup to meet a business need on my side. The picklist value for both parent and child must be active. It looks like you have inactive values. I'd be happy to accept a pull request that contained a switch to the picklist.. probably at this level: child_field_picklist = autotask_connection.picklist['Ticket']['SubIssueType']
child_field_picklist.ignore_inactive = False but I'd also accept: autotask_connection.picklist.ignore_inactive = False or, as a stretch goal. both. |
or, if it is active, and it's failing a match because parentValue seems to be a text value because of I'll try to get a fixed version out soon. I'm thinking: Lines 37 to 47 in 6515a19
becomes: def get_field_picklist(field_name, field_info):
field_picklist = find('Name',
field_name,
field_info.Field)
# Convert Picklist Values to int
# See issue: https://github.com/MattParr/python-atws/issues/53
for item in field_picklist.PicklistValues:
for picklist_value in item[1]:
setattr(picklist_value, 'Value', int(picklist_value.Value))
if picklist_value.parentValue:
setattr(picklist_value, 'parentValue',
int(picklist_value.parentValue))
return field_picklist |
That would be great. Things have been pretty crazy lately, but i'll look for that change. |
I recently ran into this issue too. @MattParr I have been testing with your proposed change and haven't had any issues yet and can't think of anything that it would break. |
In some cases,
will throw an exception: Instead, this has not caused issues for me yet:
|
Is this fix something that is going to be added in soon? |
Hi @natchu |
@MattParr Sure, I can create a fix for the same and raise a pull request. |
OS: Windows 10 Enterprise
Python: 3.8.1 x64
Version: atws-0.5.5
Running a SubIssueType picklist lookup such as:
autotask_connection.picklist['Ticket']['SubIssueType']["SIEM"]["Review"]
Raises a KeyError exception:
('label not found in index', 'Label', 'Review')
Despite the fact that they are valid issue and subissue types.
The problem appears to be with
python-atws/atws/picklist.py
Lines 137 to 141 in 6515a19
Where
self.parent_item_value
is an integer, butpicklist_value.parentValue
is a suds Text object causing the condition to return false when it shouldn'tThe text was updated successfully, but these errors were encountered: