JSM Automation Send web request Smart Value not the same as output of Smart Value in Log

Ryan Fisch October 31, 2024

I have a variable {{request}} which when logged prints the proper JSON object which is verified to work in Postman as well as when pasted into the body of Custom Data for a POST request.  But when I use {{request}} as the body the request is bad and fails, even though the same output worked when pasted from the Audit Action of the same variable?

Screenshot 2024-11-01 at 8.25.27 AM.png

 

Screenshot 2024-11-01 at 8.25.44 AM.png

Screenshot 2024-11-01 at 8.25.51 AM.png

Screenshot 2024-11-01 at 8.26.01 AM.png

The SmartValue in the "SummaryRequest":

{ "model": "gpt-4-turbo", "messages": [ { "role": "system", "content": "You are a helpful assistant that summarizes Jira issues." }, { "role": "user", "content": "Summarize the following Jira issue in a single sentence with 20 words or less and don't include the words JIRA or Issue in the summary:{{ProposalLevelThree}}" } ], "max_tokens": 150, "temperature": 0.5 }

 

Screenshot 2024-11-01 at 8.26.59 AM.png

Log Action Output for "{{SummaryRequest}}"


{ "model": "gpt-4-turbo", "messages": [ { "role": "system", "content": "You are a helpful assistant that summarizes Jira issues." }, { "role": "user", "content": "Summarize the following Jira issue in a single sentence with 20 words or less and don't include the words JIRA or Issue in the summary:A common business problem in the Electronic Health Record (EHR) space is managing patient follow-up and appointment adherence effectively. Many healthcare providers struggle to keep track of missed appointments, identify patients at risk of non-adherence, and ensure timely follow-up care. This often leads to poorer health outcomes, increased costs, and administrative burden for providers. Feature Idea: Automated Follow-Up and Adherence Tracking System Business Problem: Providers need an efficient way to track patient adherence to scheduled appointments and follow-up care recommendations. Currently, missed or canceled appointments go untracked, and follow-ups are often handled manually, which is both time-consuming and prone to error. This can lead to gaps in patient care, increased risk for complications, and preventable health issues. Feature Solution: Develop an Automated Follow-Up and Adherence Tracking feature within the EHR that: • Automatically flags patients who miss or c"}], "max_tokens": 150, "temperature": 0.5 }

 

Send Web Request Log Output:

Send web request
Error publishing web request. Response HTTP status:
400
Error response HTTP body:
{ "error": { "message": "We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)", "type": "invalid_request_error", "param": null, "code": null } }

1 answer

1 accepted

3 votes
Answer accepted
Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 31, 2024

@Ryan Fisch , Welcome to the Atlassian Community!

Could you share some screenshots about how you're collecting this variable to use in Jira Send Web Request?

This will help us to see if there's anything else missed.

Ryan Fisch November 1, 2024

UPloaded images of Variable Configurations as well as log outpts.

Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 1, 2024

@Ryan Fisch ,

I believe it is the special characters contained in your message content. I would say you should try the following: {{SummaryRequest.jsonEncode}}

I have had other integrations done with OpenAI and it worked fine using .jsonEncode on my variables.

Could you try and see if it works?

Ryan Fisch November 1, 2024

Trying now....

Ryan Fisch November 1, 2024

That was it, thank you so much....what I was missing is a list of functions available for Smart Value's is there a good page with a comprehensive list?

Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 1, 2024

Glad to know that worked, @Ryan Fisch 

You can see this page here to know more about variables functions in Jira: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/

Have a nice weekend!

Like Ryan Fisch likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events