Lost jenkins job parameters after execution

Jenkins setup:

  • jenkins version 2.14.1
  • copy artifact version: 705.v5295cffec284

Hello
Our Jenkins instance has recently been updated to version 2.414.1
Following the update, it has been noticed copy artifact required to improve the pipeline code to add additional permissions

nothing change in the pipeline code, expect adding the following lines for copy artifact.

 properties([
      copyArtifactPermission(currentBuild.projectName),
 ]);

It seems that since that modification has been introduced, and the plugin has been set to production mode, certains pipelines that have been executed lost all their parameters →
On the job configuration, the option “this project is parameterized” became deactivated and all the parameters have been erased.

I would like to know if someone encountered the same issue ? or maybe overcome this issue?

Many thanks in advance
regards,
Yannick

This happens as you did not add the parameters to the properties array. Either manage all the properties from the Gui( including permissions) or from the jenkins file, but don’t mix, as properties will overwrite everything, not patch just changed settings.

Hi @bpedersen2
many thanks for your quick answer
I was looking at the documentation but it doesn’t seem very explicit

In the job configuration I can see the flag “Permission to copy artifact” / Projects to allow copy artifacts
Do you mean this should be deactivated and the permission managed directly in the groovy script?

many thanks in advance