Pass pipeline input job parameters to be redirected to some file

hi,

i need to pass pipeline input job parameters to be redirected to some file
could you pls help

Where do you want this file to be stored?

want to store in jenkins container itself

below is path for workspace of jenkins project

/var/jenkins_home/workspace/Testjob
i need file to be created and corresponding job param should be stored in JSON format .
/var/jenkins_home/workspace/Testjob/test.json.
will be writing declarative pipeline script in job itself

This can help:

Additionally you might find archiveArtifacts command helpful if your workspace is deleted after your job is done