Hi Everyone,
I can't figure out how I can use Smart Values in a JSON API Request. This is the request i'm doing:
{
"briefDescription": "TEST",
"action":"{{field.priority.name}}"
}Except, the action in the payload stays empty.
{
"briefDescription": "TEST",
"action": ""
}I just used the priority.name as a example, but it should give a output anyways which it doens't. I'm not sure if i'm doing anything wrong.
Hope someone can help me out.
It sounds like you are working with Jira Automation and trying to send data to an external API. This is a common hurdle, and the issue usually boils down to the context of the trigger or how the Smart Value is being escaped for JSON.
Here are the most likely reasons your Smart Value is returning an empty string and how to fix them.
1. Check the Trigger Context
Smart Values rely entirely on the "object" that triggered the rule.
Is it an Issue-based trigger? If your rule starts with "Scheduled" or an "Incoming Webhook," the automation engine doesn't automatically know which issue to look at. You might need a "For Each: Issues" branch or a "Lookup Issues" action first.
Does the field exist? If you are using {{field.priority.name}}, make sure the issue actually has a priority set. If the field is empty on the Jira ticket, the JSON output will be empty.
2. Use the Correct Syntax
While {{field.priority.name}} sometimes works, the standard and more reliable syntax for the Issue Priority is: {{issue.priority.name}}
Try updating your payload to this:
{
"briefDescription": "TEST",
"action": "{{issue.priority.name}}"
}
3. Handle JSON Escaping (The asJsonString Function)
If your Smart Value contains special characters (like quotes, newlines, or backslashes), it can break the JSON structure, causing the receiving API to reject it or the automation to fail silently.
Jira provides a specific function to ensure the value is safe for a JSON payload: {{issue.priority.name.asJsonString}}
4. Debugging with the "Log Action"
Before sending the Webhook, add a Log Action right before it.
In the log message, paste: Priority is: {{issue.priority.name}}
Run the rule.
Check the Audit Log. If the log shows "Priority is: ", then the Smart Value is failing to fetch the data. If the log shows "Priority is: High", then the issue lies in the Webhook configuration or the receiving server.
I was working on something similar with the Send web request automation. The syntax in your original post should be fine.
I think the problem is that {{field.priority}} is not a valid smart value. It should be {{issue.priority.name}}.
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.
Hey @Damian Eickhoff
Welcome to Atlassian Community !!
I guess you are trying to pass smart value in advanced editing option for automation rule.
So there are few allowed smart values that can be converted into JSON format as documented here https://support.atlassian.com/cloud-automation/docs/jira-smart-values-json-functions/
See if this helps.
Regards,
Vishwas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vishwas ,
Thank you for your response and welcome !
Yes, I try to use these smart value in a web request. I already read that documentation you are referring to, but even if I do:
{
"briefDescription": "TEST",
"action":"{{field.priority.name.asJsonString}}"
} the payload for "Action" would still be empty. So no luck there unfortunately.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Damian Eickhoff
Haven't tried this yet, just saw the document and shared. I will give a try and get back.
Thanks,
Vishwas
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.
Hey @Damian Eickhoff
Not yet, if you can send me the screenshot of the automation rule. i will try to use the same and try further
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.