Help with API interaction and JSON encoding/decoding

I’m currently working on an integration project where I need to pass some values over from RT to an external project management app’s REST API. The process should be quite simple, whenever an RT ticket is created I should pass on the necessary values onto the external API, create a corresponding ticket over at hour Project Management App, and then return with values regarding that ticket in order to update the RT ticket status. Since I’m a total perl novice, I would appreciate some help with this part:

If I understand correctly what I need to do is work with the REST::CLIENT and JSON modules in order to encode my values into a JSON object, pass them over to the external API, then decode the response JSON object back into Perl, and use those newly acquired values to update my RT ticket. For that, I could really use some code examples on how to do it, both the encoding/decoding part and the API interaction.

You could have an RT scrip that runs “On Create” and calls some other bash script ( This way you don’t have to use Perl ) that then communicates the ticket info to the PM app. There is this thread that uses this approach for a slightly different problem:

When updating a ticket in RT you can use the REST2 extension and write some code to send the data to RT, an example using Curl that changes the subject and a custom field values:

curl --request PUT 'https://MyRT.com/REST/2.0/ticket/3' \
        --header 'Content-Type: application/json' \
        --data-raw '{
                "Subject": "Updated from REST2", "CustomFields": {"foo": "bar"}
        }'