Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

use smart value in web request with JIRA REST API

Kenneth Robinson June 28, 2023

When I try to use smart values with JIRA REST API, I get an error message that the JSON is not properly formatted.

web-request.png

 

I have tried {{issue.description}} and {{issue.fields.description}} with and without quotes. If I replace the smart value with text, the comment is correctly updated.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2 answers

1 vote
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 3, 2023

Hi @Kenneth Robinson ,

Use: 

"body": "{{issue.description.jsonEncode}}",

 instead of "body": "{{issue.description}}",

It will ensure that the description data is properly encoded.

Good luck!

Rudy

Kenneth Robinson July 4, 2023

Thanks that worked.

Like Rudy Holtkamp likes this
Philipp Wieseckel
Contributor
June 24, 2024

This does not work for me and:

{
"accountId": "{{triggerIssue.reporter.jsonEncode}}"
}

0 votes
Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 28, 2023

Hi @Kenneth Robinson ,

Try using the "asJsonString" function along with the smart value.

Eg. {{issue.fields.description.asJsonString}}

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-json-functions/

Kenneth Robinson July 4, 2023

@Jehan Bhathena Thanks for the suggestion, but that didn't work. However using "jsonEncode" did work for me.

Like Jehan Bhathena likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events