User Story Validation stuck

If the Validation of a User Story is taking longer than usual, something might caused the process to fail at some point causing the validation to get stuck leaving the validation pop up in the User Story interface "locking" the user story record.

User-added image

Although the pop up can be hidden, it will appear again every time you open the user story and this one will keep refreshing continuously. The information below will help you understand what happened and how to stop the validation.

The validation process of a User Story is the same as if we enable the checkbox "Promote and Deploy" in the user story but, when we validate, the Deployment record that is created contains a CheckOnly deployment step so that nothing is deployed. The validation process will create a Promotion record and a validate only Deployment record. Once the validation deployment is completed successfully or with errors, the validation process will finish. It is important to understand that Copado will only consider that the validation process is completed when the status of the Validation Deployment is "Completed Successfully" or "Completed with Errors". If the deployment doesn't complete (status In Progress) or it never start (status Draft), Copado assumes that the Validation process is not completed yet and the user story will keep refreshing until the Status of the deployment changes to "Completed Successfully" or "Completed with Errors". 

There are 3 fields in the User Story object that will help you check the status of the validation.

- Last Validation Deployment.
- Last Validation Promotion.
- Last Validation Deployment Status.

User-added image

If you do not have these fields in the layout you can add them or you can run a report of User Stories, filter by the "User Story Reference" an add the 3 fields to the report to see their current values.

Once you have located the 3 fields, review the possible causes below that could have caused the validation to get stuck.

Scenario #1. There is problem with the User Story or its feature branch and the deployment step is not created in the Validation Deployment record. This will prevent the deployment from starting and the status will be always Draft.

The "Last Validation Deployment Status" field shows status "Draft". The same status is displayed in the User Story Promotions related list.

User-added image

User-added image

If you click on the Last Validation Deployment link you will notice that the deployment doesn't have any step. This deployment will never start and the status will never change.

User-added image

In order to complete the validation you need to change the status of the deployment manually by doing a url hack to access the edit page overriding the visualforce page. The url would be similar to this one:

https://COMPANY_DOMAIN/RECORD_ID/e?nooverride

User-added image

This scenario will happen also if you have the Online Conflict Resolution feature enabled in your deployment flow. If there is a conflict during the merge of the feature branch into the validation promotion branch, the validation deployment record will be created without step and you will have to follow the steps above to complete the validation of the user story after resolving the conflicts manually in the validation promotion record.

Scenario #2. There was a problem during the execution of the validation deployment that prevented the status from being updated to Completed and it's stuck on In Progress. 

If you log into the target org and navigate to the Deployment Status page in Setup you will confirm the validation deployment was already completed.
The "Last Validation Deployment Status" field in the user story still shows status "In Progress". The same status is displayed in the User Story Promotions related list. If you click on the Last Validation Deployment link you will see the deployment with status In Progress. 

In order to complete the validation you need to change the status of the deployment manually by doing a url hack to access the deployment page overriding the visualforce page.

https://COMPANY_DOMAIN/RECORD_ID?nooverride

Once you are in the standard page click on the Deployment Step name and then click in the Deployment Job name in the Deployment Jobs related list. Change the status of this record to Success or Fail and "% Deployed" to 100 or 0 depending if the validation deployment was successful or not and Save the changes.

 

How did we do?