Trying to update multiselect dynamic field thru webservice

Moderator: crythias

Locked
bdarilek
Znuny newbie
Posts: 1
Joined: 01 Oct 2020, 22:22
Znuny Version: 6.0.24
Real Name: Brant Darilek

Trying to update multiselect dynamic field thru webservice

Post by bdarilek »

Hello, I'm trying to update a multiselect dynamic field with a webservice, but I keep getting the following error:

Code: Select all

$VAR1 = {
  'Error' => {
    'ErrorCode' => 'TicketUpdate.InvalidParameter',
    'ErrorMessage' => 'TicketUpdate: DynamicField->Value parameter is invalid!'
  }
};
I'm able to update text dynamic fields not problem, and I've looked all thru the documentation to see if there is anything on updating a multiselect.

Below is my attempt for mapping the field.

Code: Select all

<?xml version="1.0"?>
<xsl:transform
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:math="http://www.w3.org/2005/xpath-functions/math"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	exclude-result-prefixes="xs math" version="3.0">
	<xsl:output indent="yes" omit-xml-declaration="yes" />
    <xsl:template match="RootElement">
        <xsl:copy>
            <UserLogin>
                <xsl:value-of select="//UserLogin"/>
            </UserLogin>
            <Password>
                <xsl:value-of select="//Password"/>
            </Password>
            <TicketID>
                <xsl:value-of select="//TicketID"/>
            </TicketID>
            <DynamicField>
                <Name>TextField</Name>
                <Value>Value</Value>
            </DynamicField>
            <DynamicField>
                <Name>Multiselect</Name>
                <Value>Value1</Value>
                <Value>Value2</Value>
            </DynamicField>
        </xsl:copy>
    </xsl:template>
</xsl:transform>
Any help would be appreciated.
root
Administrator
Posts: 4251
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Trying to update multiselect dynamic field thru webservice

Post by root »

Hi,

Is it possible to show your request?

- 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 ?
root
Administrator
Posts: 4251
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Trying to update multiselect dynamic field thru webservice

Post by root »

Hi,

Your values need to be an array of the multi-select fields keys:

Here the JSON payload from a working REST call

Code: Select all

{
  "DynamicField": {
    "Name": "MultiSSelect",
    "Value": [
      "A",
      "C"
    ]
  },
  "SessionID": "V2592FjLhK3qACOMJgM94F1LCVc01Qpa",
  "TicketID": 1
}
- 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 ?
Locked