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

Get ID from API results

João Cunha March 6, 2024


I'm new to Jira and Jira automations using API. I need to get an ID from an API result but i'm not getting how to do this.

I have a manual automation that asks the user which customer/client they want to add in a custom field. The format that users will use to fill in the field is "NAMEOFCLIENT_IDENTIFICATIONNUMBER" for example: ATLASSIAN_123456789


I need to check if the number after _ is already in the custom field. If so, I need to get the ID to update the custom field (can't figure out ou to get the ID)

if the number was not found then the automation will add the client to the custom field (managed how to do this)

I currently have this configuration:



the result of this is something like:


image.pngFor example, if the user adds a client as "TEST_51488987", how can I get the ID from the "value":"2LIGHT-HEALTHCARESOLUTIONSLDA_514188987" so I can update the option with "TEST_51488987"?


Thank you!



3 answers

2 accepted

1 vote
Answer accepted
Kalyan Sattaluri
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.
March 6, 2024

Hello @João Cunha 

Yes, your API response can be iterated using {{webhookResponse.body}}, BUT,

your requirement of finding the ID based on a value cannot be done if the value you are looking up is also a variable or smart value. It just does not resolve inside the loop.

For example:

{{#webhookResponse.body.values}}{{#if(value, "TEST_51488987")}} {{id}} {{/}}{{/}}  <-- will work

{{#webhookResponse.body.values}}{{#if(value, {{teste}})}} {{id}} {{/}}{{/}} <-- Will not work


As you can see, first example works because the lookup value is hardcoded, in second example, your lookup is from user entry, so its in a variable will not work... Thats because in the scope of the iteration, {{teste}} does not exist.


Now to sol;ve your issue.

Only thing I can think of is to store {{webhookResponse.body.values}} in a variable AND then using below thread, you have to create lists of value's and ids and based on if there is a match for a value, get the index and so you can get the ID.

I know what I said is confusing but in a nutshell, what you want cannot be done natively. Option is to store that webreponse.body and somehow parse it.





0 votes
Answer accepted
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.
March 6, 2024

Hi @João Cunha 

If you're using the Web Request Action, then to use it's value in the next steps you need to use the smart value {{webhookResponse}}



0 votes
João Cunha March 7, 2024


Thanks for your quick reply! I'll try your solutions!

Have a great week.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events