I'm building some automation rules to check some Asset Attributes, an to modify other attributes depending on some values.
The logic I build is the following:
Rule 1)
[Asset-1, Asset-2, Asset-3..]
Asset-1 --> USER ID-1
Asset-1 --> USER ID-1 --> Last active dates of that user ID Json Object
Last active dates has the following format.
{productKey=confluence.ondemand, lastActiveTimestamp=2025-04-21T07:40:21.979864451Z, cloudSiteId=XXXX}, {productKey=jira_addon, lastActiveTimestamp=2025-04-18T10:04:46.620857038Z, cloudSiteId=XXXX}, {productKey=jira-core.ondemand, lastActiveTimestamp=2025-04-21T07:45:45.275296075Z, cloudSiteId=XXXX}, {productKey=jira_platform, lastActiveTimestamp=2025-04-21T15:10:36.658960768Z, cloudSiteId=XXXX},
Until here everything works well.
I get the asset ID, I get the user ID associated to it, and the last active dates of that user ID.
But now I want to loop over that Last Active Dates JSON Object. As Jira does not allow to create a branch within a branch, I created an incoming webhook where I send the Last Active Json Object. I followed this article for dynamic looping. How to create a Dynamic Loop in Automation for Jira
I know I can loop using List in smart values properties, but that option does not solve my need, as I need to filter and to manipulate the data later on.
My problem is the following:
When I build the custom data on the Send Web Request, I don't find the way to send a Json Object. If I follow the article instructions I send text, instead of a Json Object, so I cannot loop over it on the second rule.
Rule 1:
Rule 1 Send Web Request format:
My problem is here:
How can I define "lastactivedates" to send a Json Object instead of text!
As you can see, I add apostrophe around lastactivedata web response, so it is sent as text, instead of an json object. I know is text because I cannot loop over it on the rule 2 and I can split it or count characters.
Rule 2)
If I remove the apostrophes, I get the following error:
There was an error when trying to parse the webhook body to JSON (could be due to un-escaped control characters like newlines):
Unexpected character ('d' (code 100)): was expecting double-quote to start field name at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 2]
I hope someone can help me!
Thanks in advance.
Hi @Alfredo -- Welcome to the Atlassian Community!
In your second rule, please try using the function jsonStringToObject() to parse / convert the input:
If that does not work, you may need to use other text functions, including match() with regex, to parse and then iterate over the data as a list.
Kind regards,
Bill
I've seen that @Bill Sheboy is an automation expert. Maybe you could help me a bit with this topic.
For everyone; If more clarifications or screenshots are needed, don't hesitate to let me know.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.