KBEC-00439 - Use properties to cushion the difference between environments

Article ID:360038932351
1 minute readKnowledge base

Summary

Property is a powerful feature in CloudBees CD (CloudBees Flow).

Problem

You have several CloudBees CD (CloudBees Flow) environments (for example, dev, test and production). You need to export a pipeline (procedure, or any other object) from one environment (as DSL or other format) and import it to another environment. However, the import always fails because some data (for example, a user who is the approver of a manual task) in the procedure does not exist in the target environment.

Solution

Don’t use the user directly , instead use a property like "ProductApprover" as the approver in the manual task. Then set different values for the property "ProductApprover" in different environments. This way when the pipeline runs, the property "ProductApprover" will be expanded to the correct user. And the import will succeed as there’s no unknown data in the pipeline (as the property "ProductApprover" will not be expanded during the import).

Here’s a screenshot of using property as the approver of a manual task:

task_approver.png