How to create web service invoker for sending HTTP request when ticket is updated

Moderator: crythias

Post Reply
mrin9san
Znuny newbie
Posts: 1
Joined: 02 Jan 2024, 19:48
Znuny Version: 6.4.1
Real Name: mrinmoy sandilya
Company: pathway communications

How to create web service invoker for sending HTTP request when ticket is updated

Post by mrin9san »

I want to establish a two way connection between OTRS and Pipefy. For now I can communicate from Pipefy, when changes in Pipefy occurs, it triggers creation of ticket in OTRS.

But I want the other way around too, like when ticket is updated in OTRS, it should send an http Rest request to Pipefy.

How to proceed for this? I am aware that there is a invoker function available but its not showing (not highlighting) when I try to create a webservice. Please help.
skullz
Znuny superhero
Posts: 624
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: How to create web service invoker for sending HTTP request when ticket is updated

Post by skullz »

Under webservice > your webservices

1. Znuny as requester > Invoker > Add Invoker > Ticket::Generic

You have to define the invoker name, e.g: UpdatePipefy.

a) Mapping for the Outgoing data: XSLT
this is totaly depend on the structure of the target webservice (Pipefy).

Example
Send parameter Hash that contain values from ticket dynamic field named Hash

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date">
    <xsl:output method="xml" encoding="utf-8" indent="yes"/>
    <xsl:template match="RootElement">
        <xsl:copy>
          <Hash><xsl:value-of select="//Ticket/DynamicField_Hash" /></Hash>
        </xsl:copy>
    </xsl:template>
</xsl:transform>
b) Event: choose what ticket event (e.g: StateUpdate / QueueUpdate / DynamicFieldUpdate ) that will trigger the webservice call.


2. Znuny as requester > Network transport > HTTP::REST

Define Pipefy webservice endpoint, controller, request method, maybe additional header..


3. Always check the webservice log. That should help you further

4. You may refer attached example of VirusTotal webservices (Invoker: Files).

good luck
You do not have the required permissions to view the files attached to this post.
Post Reply