I want to get the latest version change record from the jira cloud system audit log to get the old version name and the new version name for further automation for a 1-way sync of release versions (create, update, delete) to another project.
When I use a web request block in the automation to get the audit log record I'm looking for it looks like this:
{
"offset": 0,
"limit": 1,
"total": 1286,
"records": [
{
"id": 18896,
"summary": "Project version updated",
"remoteAddress": "000.000.000.000",
"authorKey": "0a",
"authorAccountId": "0a",
"created": "2024-01-31T07:58:21.296+0000",
"category": "projects",
"eventSource": "",
"objectItem": {
"id": "10341",
"name": "C-0.0.0",
"typeName": "VERSION"
},
"changedValues": [
{
"fieldName": "Name",
"changedFrom": "C-0.0.3",
"changedTo": "C-0.0.0"
}
],
"associatedItems": [
{
"id": "10014",
"name": "Sandbox CONTXT",
"typeName": "PROJECT"
}
]
}
]
}
The values I'm trying to access, I would expect to access by:
- `{webResponse.body.records(0).changedValues(0).changedFrom}}
- {{webResponse.body.records(0).changedValues(0).changedTo}}
However these produce no value when logging them in automation.
I am able to get a single value array using the following, but this doesn't help me as I still can't access the single value in the array as a string:
- {{webResponse.body.records.changedValues.changedFrom}}
- {{webResponse.body.records.changedValues.changedTo}}
I get values like this:
- [C-0.0.3]
- [C-0.0.0]
Then trying to access these values something like set it to a smart value, {{value.get(1)}} returns nothing when logging it with the automation.
How can I access the values as strings like the following?
- {{changedFrom}}="C-0.0.3"
- {{changedTo}}="C-0.0.0"