Our organization is trying to use CiviCase as a ticketing system. So we have one case type, the "Ticket".

We can have multiple Tickets open for the same client. However, I can't assign the same contact as a "Case Manager" for multiple tickets to the same client.

So let's say client A has 2 open Tickets. On the first Ticket, I assign myself as the Case Manager. That works as expected. However, when I try to assign myself as the Case Manager of the second Ticket for client A, I get an error:

The relationship type definition for the case role is not valid for the client and / or staff contact types.

If I create 2 cases to the same client, I am automatically assigned as a Case Manager to both of those cases. However, if I remove myself as Case Manager, and try to re-add myself, I get the same error as above.

How can I assign myself (or anybody else) as the Case Manager of multiple cases to the same client.

  • Which version of CiviCRM?
    – Coleman
    Commented May 27, 2015 at 17:08
  • I'm running 4.6.0 Commented May 27, 2015 at 19:07
  • 2
    We're running up against this after upgrading to 4.6.3. We were able to do it on 4.5 but lost the ability along the way.
    – pmoz
    Commented Jun 2, 2015 at 17:44
  • 1
    We are also running up against this, but with all Case Roles-- not just the Case Manager. We have also seen this introduced as a regression-- we upgraded from 4.5.4 to 4.6.4.
    – Angela
    Commented Aug 6, 2015 at 15:26

1 Answer 1


So, I know it's against best practices, but after digging into the code a bit, I've located a (hacky) solution to my problem. When adding a Case Manager via a case view, CRM_Contact_BAO_Relationship::legacyCreateMultiple is executed.

At line 194 there's a check for duplicate relationships. If I comment out the "continue" at line 203 within the dupe check, I can successfully assign the case manager to the case.

I would much rather not have to do a core edit, so I await a better solution.

Edit: I had run into a problem elsewhere that ended up being caused by my hack. I do not recommend implementing my hack as I'm not sure of the implications.

  • Did you file an issue in Jira for this?
    – Angela
    Commented Aug 6, 2015 at 15:26
  • 1
    This code must not fire if changing a contact as a role, but only if filling in a blank. If a contact is trashed and added, it seems that the problem is encountered. If a false contact is put in there and changed to the "problem contact", the system freely accepts the entry.
    – Angela
    Commented Aug 6, 2015 at 16:13
  • I can verify that this works for all of the Roles experiencing this problem, but I agree that this is outside of best practices.
    – Angela
    Commented Aug 6, 2015 at 16:48
  • 1
    github.com/civicrm/civicrm-core/pull/6439 fixes the issue! Commented Aug 7, 2015 at 11:59
  • Jitendra's solution worked for me. Commented Aug 17, 2015 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.