Defect #1430

Contract with highest "valid from" is returned as prime contract

Added by Alena Peterová 8 months ago. Updated 8 months ago.

Contractual relationship
Target version:
Start date:
Due date:
% Done:


Estimated time:


Version: 9.3.1

When computing prime contract and no contract is set as "main position", then the contract with lowest "valid from" should be returned according to doc (

But the contract with highest "valid from" is returned.

Affected functions:
  • bulk role assignment (when using "Assign to main contract only"]
  • default role for synchronization is assigned only to prime contract
  • groovy scripts that use identityContractService.getPrimeContract or getPrimeValidContract


#1 Updated by Alena Peterová 8 months ago

  • Target version set to Onyx (9.3.3)

If possible, would you please include fix to 9.3.3? It would save a lot of project-specific implementation if we could use the default strategy of computing prime contract (= lowest valid from).

#2 Updated by Radek Tomiška 8 months ago

  • Status changed from New to In Progress

#3 Updated by Radek Tomiška 8 months ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Ondřej Kopr
  • % Done changed from 0 to 90

I fixed behavior of computing prime contract, there was wrong comparing of valid from dates:

Could you do a feedback, please?

Note: the unit test was created for this before, but the issue was hidden, because invalid test contract was created :/

#4 Updated by Ondřej Kopr 8 months ago

  • Assignee changed from Ondřej Kopr to Radek Tomiška
  • % Done changed from 90 to 100

Thanks for update behavior for computed prime contract. Now it works as is described in ticket.

For example:
  • Contract [id:1] validTill: 1.1. 2019, validTill: 15.1. 2019,
  • contract [id:2] validTill: 9.1. 2019, validTill: 1.1. 2025.

As primary contract is used contract with id: 1. This behavior is wanted by the ticket.

#5 Updated by Radek Tomiška 8 months ago

  • Status changed from Needs feedback to Closed

Also available in: Atom PDF

Go to top