10 hours ago - last edited 10 hours ago
My recipe has the input parameter "Request Type". And we made a call to a JIRA API that returns this list:
{
"requestTypeFields": [
{
"fieldId": "customfield_10072",
"name": "Mobile Device Request Type",
"description": "",
"required": false,
"defaultValues": [],
"validValues": [
{
"value": "10044",
"label": "New Order",
"children": []
},
{
"value": "10045",
"label": "Upgrade",
"children": []
},
{
"value": "10121",
"label": "Device Replacement",
"children": []
}
],
"jiraSchema": {
"type": "option",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
"customId": 10072
},
"visible": true
},
{
"fieldId": "customfield_10077",
"name": "Device Storage",
"description": "",
"required": false,
"defaultValues": [],
"validValues": [
{
"value": "10061",
"label": "64 GB",
"children": []
},
{
"value": "10062",
"label": "128 GB",
"children": []
},
{
"value": "10063",
"label": "256 GB",
"children": []
},
{
"value": "10064",
"label": "512 GB",
"children": []
}
],
"jiraSchema": {
"type": "option",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
"customId": 10077
},
"visible": true
}
]
}
My requirement is to return the Value "value" among all the options ("validValues") of the field whose "name" is "Mobile Device Request Type" and whose "label" is equal to the input parameter "Request type".
I found this way to do it:
But with the "where" is try to find an exact match. That mean "New Order" <> "new order".
Is there a way to do something like:
Thnaks in advance
9 hours ago
I find "where" very restrictive, and in most cases when I have to parse a complex array I use a Ruby action and different methods like filter, find, type, etc.
My suggestions: