Metadata step added to deployment automatically

When promoting user stories with Copado, you might notice that the deployment has a Metadata deployment step apart from the expected Git Promotion step. This step was not added manually and none of the user stories in the promotion contains a Deployment Task with Metadata.

How was that Metadata step added to the deployment?

The Metadata step will be added automatically during the creation of the deployment if the any of the user stories being promoted contains components that were added with the "Add Metadata" button in the user story.

How can you identify if the "Add Metadata" button was used in the user stories?

Whenever this happens, check the following in the user stories you are promoting:

1. User Story Selections.
When you open the user story, you will see in the user story selections the components that were added to the user story. There are several columns in this section. The column on the left is "MetaData" and the next one is "Git Upserts". When the metadata is added to the user story with the "Commit Changes" button, the components will appear as selected in the column "Git Upserts".
If the components were added to the user story with the button "Add Metadata", the components will appear as selected in the column "MetaData". This will cause the Metadata step deployment to be created when promoting the user story.
If you see components marked as "Git Upserts" and "MetaData", it means that both buttons were used.

2. Attachments in the user story.
In the user stories you are promoting, check the attachment files. If you see an attachment with the title "MetaData", it means that the "Add Metadata" button was used. You will also see the components marked as "MetaData" in the user story selections as explained above.

How do you remove the components that were added to the user story as "MetaData" instead of "Git Upserts"?

You can remove the components added as "MetaData" by removing the "MetaData" attachment on the user story. 
If a component was added using both buttons, removing the "MetaData" attachment will only remove the "MetaData" selection but not the "Git Upserts" selection.
Once the "MetaData" attachment is removed from the user stories, the Metadata deployment step will not be created when the user stories are promoted.



How did we do?