Maybe this is a basic usage question but I have not ben able to find a clarification of how to do it or even if it is posible.
I am trying to get data from a ticket in RTIR 4.4.4 through the RT::Extension::REST2 API. I have managed to get the ticket information and the transaction in the history.
curl -k -H 'Authorization: token tktktk' https://<URL>/REST/2.0/ticket/76/history
{
"count" : 9,
"page" : 1,
"per_page" : 20,
"total" : 9,
"items" : [
{
"id" : "1655",
"type" : "transaction",
"_url" : "https://<URL>/REST/2.0/transaction/1655"
},
{
"id" : "1656",
"type" : "transaction",
"_url" : "https://<URL>/REST/2.0/transaction/1656"
},
...
]
}
I can get the data of each of the transactions:
curl -k -s -H 'Authorization: token tktktk' https://<URL>/REST/2.0/transaction/1655
{
"Type" : "Create",
"_hyperlinks" : [
{
"ref" : "self",
"id" : 1655,
"type" : "transaction",
"_url" : "https://<URL>/REST/2.0/transaction/1655"
},
{
"ref" : "attachment",
"_url" : "https://<URL>/REST/2.0/attachment/529"
}
],
"Created" : "2020-02-18T09:49:30Z",
"Object" : {
"id" : "76",
"type" : "ticket",
"_url" : "https://<URL>/REST/2.0/ticket/76"
},
"id" : 1655,
"TimeTaken" : 0,
"Creator" : {
"id" : "<USER>",
"type" : "user",
"_url" : "https://<URL>/REST/2.0/user/<USER>"
}
}
I have managed to conduct a limited search on the transacctions endpoint using the search syntax:
curl -k -s -H 'Authorization: token tktktk' https://<URL>/REST/2.0/transactions?query=[{"field":"Type","value":"Status"}]
{
"count": 20,
"page": 1,
"per_page": 20,
"total": 24,
"items": [
{
"id": "1036",
"type": "transaction",
"_url": "https://<URL>/REST/2.0/transaction/1036"
},
{
"id": "1038",
"type": "transaction",
"_url": "https://<URL>/REST/2.0/transaction/1038"
},
...
]
}
What I want to find is a way of obtaining all the transacctionsin a known ticket of certain type. How can I define a search based on a second level value in the JSON structure of the transaction? As I understand it should be something like this, but it is not the correct syntax.
curl -k -s -H 'Authorization: token tktktk' https://<URL>/REST/2.0/transactions?query=[{"field":"Type","value":"Status"},{"field":"Object.id","value":76}]
How can I find this?