Skip to main content
premchanderr
Staff & Editor
Staff & Editor
January 16, 2025

Technical Tip: Create an API Call using Utilities Connector to list all values of a picklist

  • January 16, 2025
  • 0 replies
  • 411 views
Description

 

This article describes how to create an API Call using Utilities Connector to list all values of a picklist.

 

Scope

 

FortiSOAR v7.

 

Solution

 

Sample output: System Picklist AlertState should list all the values New, Detail Extracted, Indicator Extracted, Similar Alerts Correlated, Ready to Investigate, and SLA Set.

 

Note down the picklist IRI:

 

Picklist_IRI.png

 
  1. Create a playbook with  2 steps mainly: Under Utilities ->  Action - FSR: Make FortiSOAR API Call.

 

Inputs: /api/3/picklist_names/picklist-iri

HTTP Method: GET 

Step Utilites: PicklistName - {{vars.steps.Fetch_Picklist.data.picklists}}

 

Utilities_PicklistIRI.png

 

  1. Set Variable 'listDetails' with below for loop:

 

{%- set res = [] -%}
{%- for item in vars.PicklistName -%}
{%- set _dummy = res.append(item.itemValue) -%}
{%- endfor -%}
{{res}}

 

List_Picklist_SetVariable.png

 

  1. Save and run the playbook, now the output will list all the picklist values.

 

Picklist_PlaybookExecuted_Output.png

 

It is possible to find attached, the playbook 'Get_Picklist_Values.json' for reference.