There are multiple ways to convert a json file to csv but considering the scenario that you are working with jenkins and might have a shell as build step, so in that case you can use jq
utility. there are multiple answers which can help you.
if you are open to use any other option for build then you can use python also. which makes it much easier.
you can use pandas
module from python to convert a json file to csv using below code.
import pandas as pd
with open('data.json', encoding='utf-8') as stream:
df = pd.read_json(stream)
df.to_csv('data.csv', encoding='utf-8', index=False)