Giter VIP home page Giter VIP logo

Comments (9)

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

@toshiro92
The dynamic fields are a property of the OTRS ticket. An OTRS article does not have dynamic fields.

from python-otrs.

toshiro92 avatar toshiro92 commented on July 28, 2024

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 ?

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

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)

from python-otrs.

toshiro92 avatar toshiro92 commented on July 28, 2024

Ok great ! Thank you @ewsterrenburg

from python-otrs.

mjducharme avatar mjducharme commented on July 28, 2024

@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

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

@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.

from python-otrs.

mjducharme avatar mjducharme commented on July 28, 2024

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.

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

@mjducharme in your new code, this is handled fine

from python-otrs.

toshiro92 avatar toshiro92 commented on July 28, 2024

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'
[...]
}

from python-otrs.

Related Issues (20)

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.