Get ID from API results

Hi,

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

image.png

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:

GET https://randstad-pt.atlassian.net/rest/api/3/field/customfield_22471/context/25917/option

image.png

the result of this is something like:

“maxResults”:100,“startAt”:0,“total”:1216,“isLast”:false,“values”:[{“id”:“45888”,“value”:“2LIGHT-HEALTHCARESOLUTIONSLDA_514188987”,“disabled”:false},{“id”:“45980”,“value”:“A.B.SOARES-INDUSTRIAMETALURGICA,LDA._505608197”,“disabled”:false},{“id”:“45426”,“value”:“A.B.V.&MACHADOLDA_506804488”,“disabled”:false},{“id”:“45705”,“value”:“A.J.P.-TRANSPORTESRODOVIARIOSDEMERCADORIAS,LDA._503603783”,“disabled”:false},{“id”:“45986”,“value”:“A.J.PINTOII-DISTRIBUIÇÃO,LDA._507552393”,“disabled”:false},{“id”:“45698”,“value”:“A.MOREIRA&FILHOSS.A._504431609”,“disabled”:false},{“id”:“45308”,“value”:“ABANCACORPORACIÓNBANCARIA,S.A.-SUCURSALEMPORTUGAL_980464897”,“disabled”:false},{“id”:“45905”,“value”:“ACCELPERCONSULTINGIBERIA,LDA_508992320”,“disabled”:false},{“id”:“45382”,“value”:“ACCELYAWORLD,SLUNIPERSONAL_B08132516”,“disabled”:false},{“id”:“45149”,“value”:“ACCENTURE-CONSULTORESDEGESTÃO,S.A._502309440”,“disabled”:false},{“id”:“45384”,“value”:“ACCENTURE2BUSINESSPROCESSSERVICES,S.A._514711442”,“disabled”:false},{“id”:“46123”,“value”:“ACCIONAPORTUGALII-ENERGIAGLOBAL,LDA_513143114”,“disabled”:false},{“id”:“45520”,“value”:“ACCORDHEALTHCARE,UNIPESSOAL,LDA_508622263”,“disabled”:false},{“id”:“46237”,“value”:“ACIBÉRICA,ACE_517838141”,“disabled”:false},{“id”:“45906”,“value”:“ADEGACOOPERATIVADEMANGUALDE,CRL._500008558”,“disabled”:false},{“id”:“45513”,“value”:“ADEGACOOPERATIVADEPALMELA,CRL_500008710”,“disabled”:false},{“id”:“45917”,“value”:“ADELINOCAVALHEIRO,SOCUNIPESSOAL,LDA_507559126”,“disabled”:false},{“id”:“45678”,“value”:“ADLA-ALUMINIUMEXTRUSION,S.A._509838740”,“disabled”:false},{“id”:“46168”,“value”:“ADLANEXT,UNIPESSOALLDA_515147281”,“disabled”:false}

image.png For 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!