Forums

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

Using Smart Values in JSON request

Damian Eickhoff February 7, 2022

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.

3 answers

0 votes
Jawann Swislow
Contributor
December 7, 2023

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}}.

0 votes
Renata-Gabriela Kajcsa March 14, 2023

Hello! Have you found a solution?

0 votes
Vishwas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2022

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

Damian Eickhoff February 8, 2022

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.

Vishwas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 10, 2022

Hey @Damian Eickhoff 

Haven't tried this yet, just saw the document and shared. I will give a try and get back.

Thanks,

Vishwas

Damian Eickhoff February 15, 2022

Hi @Vishwas 

Have you already had a moment to test this?

Hope to hear from you.

Vishwas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 15, 2022

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events