Forums

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

Smart value to compare custom field list with a value and choose accordingly

Jamie Gordon
Contributor
December 21, 2023

I have an automation rule that does the following:

--Call a web service and get a payload

--Create a lookup table and extract values from the payload into keys

--Creates an issue and populate fields with the values from the Lookup table

I have a value incoming in that needs mapping into a single Select list field. The field is "Specialty" (customfield_15698).

I'm trying to write a smart value that iterates over the list of the select list and compare with the incoming value. If the value matches an item in the list, use it. If no match, then use the last value (or a specific value) in the list.

Here's my smart value. It doesn't seem to be working. I'm I using the right approach here? 

BTW - The incoming key/value is {{invoiceWorkerapp.Specialty}}

{{if{{equals({{#issue.customfield_15698.value}}, {{invoiceWorkerapp.Specialty}}{{/}}), {{invoiceWorkerapp.Specialty}}, {{issue.customfield_15698.last.value}}}}}}

If I can get a few more eyes on this, I'd really appreciate it. I've stared at this way too long. ;-)

Thanks

Jamie

1 answer

0 votes
Eugenio Onofre
Community Champion
December 22, 2023

Hi @Jamie Gordon

Are you looking to add the values from the list to an existing select list field? If yes, I would suggest using the Fields API and having your automation calling the webhook as an action.

Please let me know if any additional information is available so I can try to assist you better.

Thanks!

Jamie Gordon
Contributor
December 22, 2023

No. The Select list has static values (over 400). Occasionally the web service will provide a value that is not on that list. When the provided value doesn't match one on the list, I want to map those values to 'Unknown'. This drives a manual business process to update the list. 

Jamie

Jamie Gordon
Contributor
December 22, 2023

Basically, additions to the list have to be curated by the business. 

Suggest an answer

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

Atlassian Community Events