Service(Rest) for manipulate attach files?

Moderator: crythias

Post Reply
AlexSuslov
Znuny newbie
Posts: 4
Joined: 29 Mar 2019, 14:30
Znuny Version: OTRS 5

Service(Rest) for manipulate attach files?

Post by AlexSuslov »

Hi All!
How can I access OTRS 5 attachments?

I need:

- get a list of names files attached to the ticket
- get file by (filename, ticketID)
- attach file to ticket by (ticketID)
- attach file to article by (articleID)

Best regards.
AlexSuslov
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Service(Rest) for manipulate attach files?

Post by root »

Hi,

Check the Perl examples here: https://github.com/OTRS/otrs/tree/rel-6 ... ebservices or search for OTRS and Rest.

One small hint: attachments never belong to a ticket, they always belong to an article.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
AlexSuslov
Znuny newbie
Posts: 4
Joined: 29 Mar 2019, 14:30
Znuny Version: OTRS 5

Re: Service(Rest) for manipulate attach files?

Post by AlexSuslov »

Hi
Many thanks!

i try to update Ticket with Article (png attached)

https://doc.otrs.com/doc/api/otrs/5.0/P ... et.pm.html

Got no error response:

{"ArticleID":2176001,"TicketNumber":"10051065","TicketID":"622773"}

Article created but there is no file in the ticket or article.

Probably there is still some trick?

Best regards
Alex Suslov
AlexSuslov
Znuny newbie
Posts: 4
Joined: 29 Mar 2019, 14:30
Znuny Version: OTRS 5

Re: [Solved]Service(Rest) for manipulate attach files?

Post by AlexSuslov »

Hi!
Object Ticket and TicketUpdate is different.
Article in Ticket is Array[Article] but Article in TicketUpdate is Article.

https://doc.otrs.com/doc/api/otrs/5.0/P ... et.pm.html
https://doc.otrs.com/doc/api/otrs/5.0/P ... te.pm.html
Post Reply