I am trying to treat the response from a Rovo agent as a JSON object and reference it using dot notation. I have the agent response formatted correctly. Excerpt here:
{ "documentStatus": "PRD In Process", "documentOwners": [], "projectStatus": "", "prfaq": "", "epicTicket": "", "targetRelease": "", "designer": "", "techLead": "", "relatedDocumentation": [], "termsAndDefinitions": ""}
but I am unable to access any of the information outside the entire response.
I have tried using the 'jsonStingToObject()' method both as an entire variable creation and individually in line during the automation. I can not get any results with the jsonStringToObject call either in dot notation, or for the entire string.
Anyone here had success with either of these methods? Or know of a better one?
I came across this while trying to solve the same problem. The workaround that seems to have worked for me is saving {{agentResponse}} as a variable then passing that variable to the jsonStringToObject() function. From there I was able to use dot notation to call other values in the JSON that Rovo returned to me. Hope that helps you too!
Just following up to check if this answered your question. If so, please consider marking this one as "answered". That will help others with a similar need find solutions faster. If not, please let the community know what help you need with the rule changes.
Thanks, and kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Gallien or @Bill Bill
I'm encountering the same issue. I am able to successfully pass my {{agentResponse}} into the variable, but I have not been able to successfully pass that data into the jsonStringToObject() function.
My variable is {{agentJSON}}, do I use that as {{agentJSON.jsonStringToObject()}} or {{jsonStringToObject(agentJSON)}}?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is the second one you show, {{jsonStringToObject(agentJSON)}} and then reference the attributes needed. I recommend writing the entire thing to the audit log to confirm it contains what you expected.
And...as this is an older thread / closed question, I recommend creating a new question, perhaps adding a link back to this one for context. That will ensure more people see it and the conversation focuses on your specific needs. Thanks!
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
nvm, I found my solution:
First, I passed my agentResponse into a variable as instructed, but then because I have a lot of keys, I passed those all into a lookup table using: {{jsonStringToObject(<variablename>).<key name>}}
Then I was able to access the lookup table for my needed values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ryan_Buschmeyer - a lookup table is a great solution!
If you're looking for an alternative approach, I've found using the .asObject and .asList methods to be more reliable than jsonStringToObject() when working with {{agentResponse}}. See How to Use {{agentResponse}} in Atlassian Automation: Unlocking the Power of AI-Driven Workflows for more info on how to use them!
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.
@Bill Sheboy @Alex Gallien @Chance Douglass
Here is a Loom video showing how we are employing the Rovo response.
https://www.loom.com/share/2df6ba89a18d4069b85c2ddfe6be3e01
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure but are the agent responses JSON, I think they are text.
Do you get results, when using {{agentResponse.documentStatus}} or even simpler {{agentResponse}}
What are the responses?
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.