Dynamically update JSONB rows - POSTGRESQL
UPDATE table1
SET    jsonfield = (
   SELECT jsonb_set(jsonfield
                  , '{parent,0,steps}'::text[] || (idx - 1)::text
                  ,  val-&gt;'childStep'-&gt;0 || (val - text 'childStep')
                   )
   FROM   jsonb_array_elements(jsonfield#&gt;'{parent,0,steps}') WITH ORDINALITY a(val, idx)
   WHERE  val-&gt;&gt;'name' = 'CONFIG2'
   )
WHERE  jsonfield @&gt; '{&quot;parent&quot;:[{&quot;steps&quot;:[{&quot;name&quot;:&quot;CONFIG2&quot;}]}]}';
-- WHERE  jsonfield @? '$.parent[0].steps[*].name ? (@ == &quot;CONFIG2&quot;)';  -- equivalent alternative

db&lt;&gt;fiddle here
I compute the new jsonb value in a correlated subquery.
WITH ORDINALITY produces the array index while unnesting the JSON array with jsonb_array_elements(). The later idx - 1 adjusts the off-by-1 error from Postgres arrays being 1-based and JSON arrays being 0-based. More about WITH ORDINALITY:

How to preserve the original order of elements in an unnested array?

I added an outer WHERE condition so that only applicable rows are processed to begin with. Avoid updating rows with unchanged values as this adds costs without benefits.
You can either use the contains operator @&gt; or the new operator @? in Postgres 12 or later SQL/JSON path language. Either can use an index. See:

Update all values for given key nested in JSON array of objects

Index by subkey inside subkey inside array in jsonb