Closed toshiro92 closed 8 years ago
@toshiro92 The dynamic fields are a property of the OTRS ticket. An OTRS article does not have dynamic fields.
Hum ok, so the way to extract information from Article is to do like I wrote:
for el in ticket.articles():
print(el.attrs['CustomerUserID'])
print(el.attrs['Subject'])
print(el.attrs['Body'])
Or is there a better way about ?
You could do it like you are doing. You can also access the attributes directly, like this:
for el in ticket.articles():
print(el.CustomerUserID)
print(el.Subject)
print(el.Body)
Ok great ! Thank you @ewsterrenburg
@ewsterrenburg
Articles can have dynamic fields as well. I do not use them myself but when creating dynamic fields there are options to create them for either tickets or articles
@mjducharme @toshiro92 I stand corrected here, never used them either and falsely assumed they were only available for tickets. Guess it would be best if dynamic fields for both tickets, articles, faq's, ... are handled the same way the articles are treated for a ticket (i.e. give back a list of DynamicFields if any, an empty list otherwise).
Reopening this issue.
I use dynamicfields for tickets, but not for articles. When I coded the function, I tested it only with ticket dynamic fields, and I use it with that in production; I assumed it would work for article dynamicfields as well.
@mjducharme in your new code, this is handled fine
FYI: About the DynamicFields into an Article, on my side I can see that they are named as below into an Article:
attrs = {
'Title' : 'A title',
'DynamicField_Element1' : 'An element',
'DynamicField_Element2' : 'Another element'
[...]
}
Hello !
I tried to extract data from an Article object following the README file, but it seems the dynamicfields function into it does not working:
I did the following lines:
However, I showed the entire Article Object and studied it, and this is working by doing this: