Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

String Manipulation of agent Response object doesn't work in Automations

goncalo_santos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 21, 2025

Hi,

I've created an automation that needs to transform agentResponse. they trying to apply StringUtil functions it doesn't work. 

I tried different formats in the agent response (json or plain text). I'm able to use functions like contains, but when trying to create variables with Substring functions, never returns any value. 

{{agentResponse.substringAfter("commentContent:").substringBeforeLast("passedTriage").trim()}}

 

Initially, since I Formatted the agentResponse in json I tried using just agentResponse.fieldName, but that didn't worked, so I fallback to a String bases approach. 

2 answers

1 accepted

0 votes
Answer accepted
Himanshi
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 28, 2025

Hello @goncalo_santos , 

Welcome to community! I think you may have been affected due to the known BUG : Utility Functions on AgentResponse Throws Errors

I would suggest to save the Agent Response in one of the variables and then using substringAfter and substringBefore utility with the variable name.

Ex: 

Variable name : RovoAgent | Smart Value : {{agentResponse}}

Add log action : Substring {{RovoAgent.substringAfter("commentContent:")}} 

Please try it out and let us know the results!

Dr Valeri Colon _Connect Centric_
Community Champion
May 31, 2025

You're awesome. Thanks for jumping in on this one!

Himanshi
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 1, 2025

My pleasure! @Dr Valeri Colon _Connect Centric_ Cheers!

Hope it helped @goncalo_santos  as well! 

0 votes
Dr Valeri Colon _Connect Centric_
Community Champion
May 25, 2025

Hey @goncalo_santos 

Your smart value expression may not work as expected due to limitations in chaining multiple functions. Consider simplifying the expression or using intermediate variables to isolate each function. Ensure that the separators used in substringAfter and substringBeforeLast exist in the agentResponse. For more details: 

And consider joining the Developer Community and Github Repo

goncalo_santos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 26, 2025

Hey @Dr Valeri Colon _Connect Centric_ ,

 

The issue is not with the chain of functions. Tried an isolated substring and the result is the same. 

The only string function it seems I can make work is the .contains. 

image.png

Dr Valeri Colon _Connect Centric_
Community Champion
May 26, 2025

Thanks for the clarification, @goncalo_santos!

This is on the edge of my abilities so I can't recommend joining the Developer Community and Github Repo enough. I'll also suggest submitting a support ticket with a sample agent Response  to confirm encoding or formatting behavior.  

From your screenshot, it looks like the agent Response is returned in markdown-style formatting, possibly wrapped in triple backticks (```), which prevents smart value functions like substringAfter() from evaluating as expected.

Before applying string functions, strip formatting by adding: {{agentResponse.remove("```")}}

Then apply your original chain: {{agentResponse.remove("```").substringAfter("commentContent:").substringBeforeLast("passedTriage").trim()}}

Jira’s automation engine treats text literally when wrapped in code blocks, so string functions can't parse it correctly. .contains() works because it's just checking presence—not parsing.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events