Forums

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

Looking for the smart value for {approval.id}

Alejandro K_ Brown
Contributor
April 16, 2026

Hello and thank You kindly in advance.

Using a JSM automation that is passing JSON data to a webhook. In the automation, I have the following custom code:
{
"issueKey": "{{issue.key}}",
"summary": "{{issue.summary}}",
"requestType": "{{issue.Request Type}}",
"issueUrl": "{{issue.url}}",
"approvalId": "{{approval.id}}",
"approvers": "{{issue.Approvers.accountId}}"
}

When passed to the target schema, the outputs line up perfectly EXCEPT the approvalId data. Every other variable at the target is filled in correctly. Only the approvalId variable is NULL.

I've tried changing the target schema to look for type 'int' instead of 'string', but see that the webhook JSON is sending 'string' for that variable, so the 'string' seems correct.

I've tried changing the smart value in the JSM automation to {approval.id} / {approvalId} / {approval} . Nothing seems to get passed into the webhook, as if none of those are the correct smart value for JSM.
ex: 

"issueUrl""https://...1022",
"approvalId""",


ANY thoughts are appreciated. I couldn't find info on this specific {approval.id} smart value on the JSM smart value page, informative as it was.

Take care and be well!

5 answers

1 accepted

1 vote
Answer accepted
Rudy Holtkamp
Community Champion
April 17, 2026

Hi @Alejandro K_ Brown ,

Assuming you do not have multiple fields called Approvals, you can use:

{{issue.Approvals.id}}

This will give you a list of all approval ids. If you only have one person that approved, you can use: 

{{issue.Approvals.first.id}}

If you have multiple fields which are called Approvals, you should search for the customfield id (e.g. customfield_12345), then you can use:

{{issue.customfield_12345.first.id}}

Note: an approval can be approved or decline, so make sure you consider {{issue.Approvals.first.finalDecision}} if that is applicable in your case.

 

Cheers,

Rudy

Alejandro K_ Brown
Contributor
April 17, 2026

This may age me, but so what.
Rudy is On Fire...
BOOOOM-SHAKA-LAKA!!!!!!

/// {{issue.Approvals.id}} /// 

is *EXACTLY* what I am looking for!
Thank You very much your insight @Rudy Holtkamp

Quick follow up if You don't mind:

Not only do I see the target app "approvalId" field populated (THE CROWD WENT WILD!!!), I see multiple numbers populating the target field.  Am I correct in assuming that these are ALL the approval IDs of the multiple approvals I've been test denying on this test ticket?

Also! Are the approval ID #s unique to the ticket (other tix in the same SPACE can have approvalID #818), the SPACE (other tix in other SPACES can have approvalID #818), or the entire JSM environment ((NO other tix in JSM can have approvalID #818)?

msedge_6agRo2ZS5E.pngmsedge_jj8QOSAQoq.png

Rudy Holtkamp
Community Champion
April 17, 2026

Great questions.

 Am I correct in assuming that these are ALL the approval IDs of the multiple approvals I've been test denying on this test ticket?

Yes they are all the approvals (approved & denied) you have given in this test ticket.

You can see them in the UI, in the activity > approvals tab (That is next to the comments)

Also! Are the approval ID #s unique to the ticket, the SPACE or the entire JSM environment?

They are unique throughout your instance.

Kind regards, have a nice weekend and keep on dancing! 💃

Rudy

Like Alejandro K_ Brown likes this
Alejandro K_ Brown
Contributor
April 17, 2026

Got another quick question for about JIRA smart value array handling.

I want to access the LAST array index in smart value array {{issue.Approvals.id}}.

Your code:
{{issue.Approvals.id}}
always returns all the indexes in the above list {796, 805, 806, ... } 
And {{issue.Approvals.first.id}}
always returns the 1st index in the above list {796} 

But as I'm testing, the LAST approval number will increase. This is the index I want to do work on.
I tried guessing 
{{issue.Approvals.last.id}}
But automation runtime audit log said "nice try buddy - NO".

Any suggestions?
Thank You kindly.

1 vote
Joseph Chung Yin
Community Champion
April 16, 2026

@Alejandro K_ Brown 

Have you already take a look at the following reference page - https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--approval--

Also, you can find out all the fields' smart value associated with your issue by following this reference page -

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Hope this helps..

Best, Joseph

Alejandro K_ Brown
Contributor
April 16, 2026

Hi Joseph!
I did check out those pages, which got me closer, but still missing the "approvalId" smart value.

In the target app that is looking for the updated webhook, it sees the following data in the webhook (redacted for security.)  We can see that every other variable in the webhook has correct data. Except for the "approvalId" spot, which is an empty string.
As if I might not have the smart value right in the 1st place.
This also verifies that the webhook data content-type is JSON (had to manually type that into the additional info of the JSM automation).

msedge_FbleY1XYPy.png

Like Arkadiusz Wroblewski likes this
1 vote
Bill Sheboy
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 Champions.
April 16, 2026

Hi @Alejandro K_ Brown 

Without seeing all the details of your rule and audit log, I wonder: what is the trigger for your rule?  The {{approval}} smart value is only populated with the approval-related rule triggers:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--approval--

 

Kind regards,
Bill

Alejandro K_ Brown
Contributor
April 16, 2026

Hi Bill, I can share what the automation trigger looks like.

But even on that page You shared, it doesn't mention {approval.id} unless the Approval ID is one of these other smart values?

To clarify, when the ticket status is set to [APPROVAL PENDING], and those conditions are applied, POST that data in the webhook. The other variables are successfully filled in except "approvalId".

msedge_tpntIdLgSu.png

Bill Sheboy
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 Champions.
April 16, 2026

Reviewing the documentation from that link, the two triggers which support the {{approval}} smart value are:

 

Additionally, the documentation does not show an id attribute, while it does show others.  Please note that not all attributes are in the documentation; often experimentation is required to find the others.

Where did you find {{approval.id}} documented?

 

 

Like Arkadiusz Wroblewski likes this
Alejandro K_ Brown
Contributor
April 17, 2026

Following up on your question Bill:

"Where did you find {{approval.id}} documented?"
NOT in the JIRA/JSM docs that I could easily find, that's for sure.
It was suggested by 2 different AI's (CoPilot and Gemini).

Thank You again and be well!


Bill Sheboy
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 Champions.
April 17, 2026

Thanks for that information, @Alejandro K_ Brown and...

I recommend not using any bot / "AI" suggested information regarding smart values, actions, etc. for automation rules...including the stuff provided by Atlassian.  My understanding is none of these tools have access to your complete product, configuration, space, etc. information, and thus the "guessers" may hallucinate based on unrelated sources.  To mitigate risks of using them, consider validating the guesses in a separate testing site away from your prod site (not just a test space), perhaps with only logging actions rather than modifying work items until the suggestions are validated.

Like Alejandro K_ Brown likes this
0 votes
Alejandro K_ Brown
Contributor
April 17, 2026

I sincerely thank EVERYONE who time out of your busy day to share some knowledge and help out.

I appreciate your time and help and wish You all continued uptime, quick issue fixes and an enjoyable weekend.

Take care and be well!

0 votes
Marc -Devoteam-
Community Champion
April 16, 2026

Hi @Alejandro K_ Brown 

An approval ID can only be seen by using the JSM API, call;

/rest/servicedeskapi/request/<key>/approval

In this call the ID of the approval on that issue can gotten.

To get detail per specific ID, use; /rest/servicedeskapi/request/<Key>/approval/{approvalId}, but you have to to the earlier call first to get the ID.

There is no smart value you can use for this, rather ten getting the ID and store this into a custom field on the issue.

Also it only applies to issues not approved.

Alejandro K_ Brown
Contributor
April 17, 2026

Thank You kindly Marc! I will definitely keep this in mind if future apps need to use the JSM API

Take care and be well.

Marc -Devoteam-
Community Champion
April 17, 2026

Hi @Alejandro K_ Brown 

Thanks for the reply and that's solved for you.

I didn't understand you where looking for the approvals, as this indeed relates to approval given, declined or pending.

I thought you where looking for a specific approval ID

Like Alejandro K_ Brown likes this

Suggest an answer

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

Atlassian Community Events