[SOLVED] Dynamic field text array with web services

Moderator: crythias

Post Reply
nedmaj
Znuny expert
Posts: 167
Joined: 26 Nov 2014, 20:34
Znuny Version: 6.3.4
Real Name: Samuel Casimiro
Company: Câmara dos Deputados
Contact:

[SOLVED] Dynamic field text array with web services

Post by nedmaj »

Hi guys,

I need a dynamic field text that can be multivalued (text array). So an user can input a value, click the plus button, add a second value and so on (like ITSMConfigItemReference from Cape-it, but for text only).

Do you know any way to do that (customizing, add on etc)?

Thanks in advance!
Last edited by nedmaj on 21 Mar 2018, 16:35, edited 1 time in total.
Samuel

Znuny 6.3.4 | OTRS 5.0.17
OS: Debian 11 | CentOS 6.5
Database: Postgres | Oracle 12.1
Number of agents: 450 | Number of customers: 20000 | Number of CIs: 30000
nedmaj
Znuny expert
Posts: 167
Joined: 26 Nov 2014, 20:34
Znuny Version: 6.3.4
Real Name: Samuel Casimiro
Company: Câmara dos Deputados
Contact:

Re: Dynamic field text array with web services

Post by nedmaj »

Hi, guys

Since I was meant to use, in this case, web services only, I figured out to use a multiselection dynamic field without fill a list of possible values. The array of values is properly store in database and retrieved when getting the ticket by web services. Commands used to test:

Authenticate and return session:

Code: Select all

curl -k 'https://<server>/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Session?UserLogin=XXXX&Password=******'
Create ticket:

Code: Select all

curl -X PUT -H "Content-Type: application/json" -k 'https://<server>/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket' -d "{ \"SessionID\": \"<session id>\", \"Ticket\": { \"Title\": \"Test Array\", \"Queue\": \"Raw\", \"State\": \"new\", \"CustomerUser\": \"XXXX\", \"Priority\": \"3 normal\", \"Type\": \"Incident\" }, \"DynamicField\": { \"Name\": \"TestMultiselection\", \"Value\": [ \"Value001\", \"Value002\" ] }, \"Article\": { \"Subject\": \"Test Array\", \"Body\": \"Test Array.\", \"ContentType\": \"text/plain; charset=ISO-8859-15\" } }"
Return ticket and verify the array of values was properly stored:

Code: Select all

curl -k 'https://<server>/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/31274' -d "{ \"SessionID\": \"<session id>\", \"DynamicFields\": \"1\" }"
Thanks!
Samuel

Znuny 6.3.4 | OTRS 5.0.17
OS: Debian 11 | CentOS 6.5
Database: Postgres | Oracle 12.1
Number of agents: 450 | Number of customers: 20000 | Number of CIs: 30000
Post Reply