how to integrating itsm config item via soap?

Moderator: crythias

Locked
denbagusjkt
Znuny newbie
Posts: 23
Joined: 07 Jun 2012, 09:20
Znuny Version: 3.1.5
Real Name: denbagus
Company: indolabsoft

how to integrating itsm config item via soap?

Post by denbagusjkt »

I need to integrate mya intranet application, writed with php with otrs itsm.
after updating rpc.pl i can use ITSMConfigItem object with soap. this is piece of my code to create new config item via soap with php :

Code: Select all

$ci_name = "POP Horizon 2";
                        /* tambahkan/add config item data pop */
			$ConfigItemID = $this->client->__soapCall("Dispatch", array($this->user, $this->pass, "ITSMConfigItem", "ConfigItemAdd",					
					"ClassID", 35, # class network
        			"UserID" , 1
			));					
			
			/* tambahkan/add data version dari config item */
			$this->client->__soapCall("Dispatch", array($this->user, $this->pass, "ITSMConfigItem", "VersionAdd",
					"ConfigItemID" , $ConfigItemID,
        			"Name" , $ci_name,
        			"DefinitionID" , 4, # network
        			"DeplStateID" , 42, # production
					"InciStateID" , 13, # incident
					"UserID" , 1
					)
			));
the result is successfull adding new item without configuration item version detail. How to add configuration item version detail?
denbagusjkt
Znuny newbie
Posts: 23
Joined: 07 Jun 2012, 09:20
Znuny Version: 3.1.5
Real Name: denbagus
Company: indolabsoft

Re: how to integrating itsm config item via soap?

Post by denbagusjkt »

this is my new code to create new config item via SOAP with php

Code: Select all

$ci_name = "wlan 3 pelanggan";
		try {			
			/* tambahkan/add config item data pop */
			$ConfigItemID = $this->client->__soapCall("Dispatch", array($this->user, $this->pass, "ITSMConfigItem", "ConfigItemAdd",					
					"ClassID", 33, # class network (35), hardware (33)
        			"UserID" , 1
			));					
			
			/* tambahkan/add data version dari config item */
			$this->client->__soapCall("Dispatch", array($this->user, $this->pass, "ITSMConfigItem", "VersionAdd",
					"ConfigItemID" , $ConfigItemID,
        			"Name" , $ci_name,
        			"DefinitionID" , 2, # network (4), hardware(2)
        			"DeplStateID" , 42, # production
					"InciStateID" , 13, # incident
					"UserID" , 1,					
					"XMLData" , Array
        (
            "0" => "",
            "1" => array
                (
                    "Version" => Array
                        (
                            "0" => "",
                            "1" => array
                                (
                                    "SerialNumber" => Array
                                        (
                                            "0" => "",
                                            "1" => array
                                                (
                                                    "TagKey" => "[1]{'Version'}[1]{'SerialNumber'}[1]",
                                                    "Content" => ""
                                                )

                                        ),

                                    "WarrantyExpirationDate" => Array
                                        (
                                            "0" =>  "",
                                            "1" => array
                                                (
                                                    "TagKey" => "[1]{'Version'}[1]{'WarrantyExpirationDate'}[1]",
                                                    "Content" => "2012-12-18"
                                                )

                                        ),

                                    "TagKey" => "[1]{'Version'}[1]",
                                    "Vendor" => Array
                                        (
                                            "0" => "",
                                            "1" => array
                                                (
                                                    "TagKey" => "[1]{'Version'}[1]{'Vendor'}[1]",
                                                    "Content" => ""
                                                )

                                        ),

                                    "Model" => Array
                                        (
                                            "0" => "",
                                            "1" => array
                                                (
                                                    "TagKey" => "[1]{'Version'}[1]{'Model'}[1]",
                                                    "Content" => ""
                                                )

                                        ),

                                    "Owner" => Array
                                        (
                                            "0" => "",
                                            "1" => array
                                                (
                                                    "TagKey" => "[1]{'Version'}[1]{'Owner'}[1]",
                                                    "Content" => "Test VPN WoW 436"
                                                )

                                        ),

                                    "Type" => Array
                                        (
                                            "0" => "",
                                            "1" => array
                                                (
                                                    "TagKey" => "[1]{'Version'}[1]{'Type'}[1]",
                                                    "Content" => 59
                                                )

                                        ),

                                    "Description" => Array
                                        (
                                            "0" => "",
                                            "1" => array
                                                (
                                                    "TagKey" => "[1]{'Version'}[1]{'Description'}[1]",
                                                    "Content" => ""
                                                )

                                        )

                                )

                        ),

                    "TagKey" => "1"
                )

        )
					
			));
			
			/* tambahkan/add data configuration Config Item*/
			
			return true;	
					
		} catch (SoapFault $fault) {
			
			return false;
		}
and now, i can create new hardware config item via soap with php.
You do not have the required permissions to view the files attached to this post.
Locked