Request transformation and json structure


#1

Hello.

I’m new in Kong, and my mayor motivation to get into this tool is that we have a 3rd party application, a Service Desk tool that publish a REST API, and of course can consume others REST APIs from others apps.

Also we have a JIRA Server, that have a REST API too. The idea is to integrate both Service Desk and Jira via APIs.

The thing is, that the JSON structure of the request to the JIRA made by my Service Desk is very strict and cannot be modified (I cannot modify the structure, but of course I can add as many parameters or values as I desire)

As an example, here is the basic structure of the request made by my Service Desk tool:

{

Parameter1=value1

Parameter2=value2

ParameterN=ValueN

}

And this is the format expected by my Jira Server:

{
"fields": {
"project":
{
"key": "CR"
},
"summary": "Nombre del issue",
"description": "enviar la descripción del issue aquí",
"issuetype": {
"name": "Error"
},
"customfield_11401": "NROTICKET"
}
}

I know that there is a plugin called Request Transformer, but I have no idea if that will help me. Somebody already had transform the structure of the request with that plugin?


#2

I am afraid there is no plugin already out there to take the top half and turn it into the bottom half, as that top half is not even valid json. This venture of yours would require writing a custom plugin and a parser for that first http body: