Forums

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

Using JSON Output from Rovo in Automations

When building automation rules in Jira that interact with AI tools or external services, you may receive a response that contains JSON and want to use it in Jira Automation.

This is my pains trying and thought I would share them...

 

First Attempt - Trying to split on ||

My first attempt was to split the two parts with a delimiter ( || ) and then split the string in a smart value, but Jira Automation was being a pain and values were not separated as expected. 

I initially structured the AI response like this:

The issue described in the ticket Access to USB drives required is similar to a previously resolved service request. This suggests that it is not a widespread problem affecting many users. Therefore, I would assign a **Medium** priority to this issue. It causes inconvenience or impacts productivity, but a workaround likely exists, and it does not prevent work from continuing entirely. || Medium

I tried to extract the priority with:

{{agentResponse.split("||").get(1).trim()}}

However, this returned empty values. you probably can do it with the split() functionality but I lost patience and it seemed to work inconsistently when extra whitespace, formatting or smart values are involved. I found it brittle, especially when AI responses included line breaks or HTML formatting. This led me to look for a more reliable approach.

 


Second Attempt - Parsing JSON instead

A robust solution is to have your AI or web service return a JSON object rather than a delimited string. For example:

{
  "reasoning": "The issue 'Unable to Print' is reported as a single‑user problem with no evidence of a system-wide outage or multiple users affected. Similar past tickets have been resolved with Medium or High priority, but none indicated a business-wide impact. Therefore, the appropriate priority is **Medium**: it impacts the user's productivity but does not block the entire team or business from operating.",
  "priority": "Medium"
}

I created a second variable that converts the string into an object:

  • Name: parsedResponse
  • Value: {{jsonStringToObject(preResponse)}}
    ## A I am using a variable I put the {{agentResponse}} in first

The function jsonStringToObject converts a string into a JSON object that Jira can traverse. 

Then tried Referencing the fields

  • {{parsedResponse.priority}}
  • {{parsedResponse.reasoning}} 

This then just returned Blank Values

 


Finally!

I created a individual variables that converts the string into an object:

  • Name: Priority
  • Value: {{jsonStringToObject(preResponse).priority}}
  • Name: Reasoning
  • Value: {{jsonStringToObject(preResponse).reasoning}}

  • Screenshot 2025-10-24 at 23.08.51.png

    Screenshot 2025-10-24 at 23.32.51.png

Use the values in your actions

  • Set the issue priority: in an Edit issue action, set the Priority field to {{Priority}}. This sends only the name of the priority to Jira
{
"fields": {
"priority": {
"name": "{{Priority}}"
}
}
}

Top Tip: Avoid adding logging actions instead use Debug

If something doesn’t work, use the #debug helper to inspect variables in the audit log:

{{#debug}}{{jsonStringToObject(preResponse).reasoning}}{{/}}

This writes the value to the audit log so you can see exactly what Jira is reading.

Hope this helps someone and saves them several hours trying to get it to work.

 

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events