The court may grant a custody order only in certain kinds of cases. Most often, custody is determined when the parents are seeking a legal separation or divorce, or when parents are asking the court to change a custody decision that was made in an earlier separation or divorce case. Custody also may be ordered when one parent starts a court case to decide paternity (or maternity) of a child. When a parent starts a court case for legal separation or divorce and the parents cannot agree about child custody, custody automatically becomes an issue for the court to decide. These court decisions are made in temporary orders hearings and in final trial if the parties are unable to reach agreement. After a decree of legal separation or divorce has been granted, the court still has authority to change (modify) an earlier custody order.