How to correctly read the form answer via smart values?

Kevin Zhang
Contributor
February 13, 2025

Hi team,

I have a form attached to a request type on a Jira service project.

 

In the automation of the request type, I read the form answer via smart value syntax.

The below JSON is used in the component `comment on issue`.

{
    "project": "{{forms.last.project_id.label}}",
    "domain": "Data",
    "datasetId": "{{forms.last.dataset_id}}",
    "location": "{{forms.last.dataset_region.label}}",
    "desc": "{{forms.last.dataset_desc}}",
    "sourceType": "JIRA",
    "source": "{{issue.key}}"
}

But I can't get any values except the issue key.

{
"project": "",
"domain": "Data",
"datasetId": "",
"location": "",
"desc": "",
"sourceType": "JIRA",
"source": "DTSD-10417"
}

The project_id, dataset_id, dataset_region, dataset_desc are the field keys of the form.

 

3 answers

2 accepted

4 votes
Answer accepted
Marc - Devoteam
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 13, 2025

Hi @Kevin Zhang 

If you are not using the forms submitted trigger in the automation.

You will need the have a field key set for a field on the form (see bottom field, in the form field details)

Then in the automation you need to use {{issue.forms.(uuid).<field key>}}

Example: {{issue.forms.eafd8203-e86d-4f5d-9ae3-a695228dcbc0.laptop}}

Even if you use the forms submitted trigger a field key needs to be provided on any field, to access the data.

Kevin Zhang
Contributor
February 13, 2025

hi @Marc - Devoteam 

 

Appreciate your help. 

 

I didn't go through the doc carefully and ignored the prerequisites of this kind of smart values.

I just see the solution you suggested at the end of the doc, using {{issue.forms.(uuid).<field key>}}. 

Finally I resolved the issue with your suggestion. The smart value is like this: {{issue.forms.<uuid>.project_id.label.get(0)}}. The project_id is a drop down selection.

 

1 vote
Answer accepted
Bob Dalm
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 13, 2025

Hi @Kevin Zhang

What trigger are you using for your rule? The {{forms.xxx}} smart value can only be used after a Forms submitted trigger, which could explain this behaviour. 

Best regards, 

Bob

Kevin Zhang
Contributor
February 13, 2025

hi @Bob Dalm  

 

Appreciate your help. 

I didn't go through the doc carefully. So I ignored the prerequisites.

Like # people like this

Suggest an answer

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

Atlassian Community Events