the part of the script that is retrieving the phase is the following:
contracts = doc.getContractDocuments();
if(contracts.size() > 0){
mainContract = contracts.get(0);
phase = mainContract.getCurrentPhase();
phaseName = phase.getDisplayName(session);
phaseId = phase.getExternalId(session);
}
It enters the conditional branch, and then send me the valus to my email (So i can know the values).
It sends me everything allright except for the external id.
Thanks in advance!