Announcement

Collapse
No announcement yet.

Assign case to ONE team only

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Assign case to ONE team only

    Hi,

    Currently a case can be assigned to multiple TEAMS, we don't wan't that. This needs to be a mandatory field to a single TEAM only. Where can I adjust this? I found something in the Entity Field Manager but I'm affraid to try this since I don't want to f*ck up.

  • #2
    You can set the permission to view the Case entity only for one Team, and set Case access to disabled or non-set for the rest of the Teams.
    In this case, the number of specified Teams will not affect access to the Case entity for Users of these Teams.

    Click image for larger version

Name:	dis.png
Views:	127
Size:	27.8 KB
ID:	104766
    However, if you want the Case entity to be unable to specify any other Team than, for example, Team A:
    1. In Administration > Teams > Team A, copy its id

    Click image for larger version

Name:	image.png
Views:	71
Size:	9.2 KB
ID:	104767

    2. In Administration > Entity Manager > Case > Formula > Before Save Custom Script​ write

    Code:
    teamsIds = '66165e30c75f60174';
    Instead of 66165e30c75f60174, specify the id of your team.

    Thus, the formula will assign the Team you need (and only it) instead of any teams that will be specified in the teams field.

    Comment


    • #3
      Hi, thank you for your reply. I don't think this is going to work since we have multiple TEAMS and some of them do have permission to view them.

      This is our situation (example):

      TEAM Accountmanagers: Person A, B, C and D

      TEAM Finance: Person E, F

      TEAM Projectmanagement: Person G

      So now an Accountmanager creates a CASE and assigns it to Team Finance. Finance picks it up and handles it and / or passes it on to TEAM Projectmanagement.

      We want to avoid that a case can be assigned to more then one TEAM at the same time thus avoiding that multiple teams are working on the same case.

      Comment


      • #4
        In this case, use several Workflows, where teams will be reassigned at each stage of working with the Case.
        And to prevent tampering with the teams field, you can disable editing this field for each team.​

        Click image for larger version

Name:	image.png
Views:	87
Size:	7.8 KB
ID:	104778

        Comment


        • #5
          Hi rfrancocantero,

          You can use API Before-Save Script:
          Code:
          if (array\length(teamsIds) > 1) {
             recordService\throwBadRequest("You can assign only one team to this record.");
          }
          Go to Administration > Entity Manager > Case > Formula > API Before Save Script and insert this formula script. You can find out more about the API Before-Save Script here:​ https://docs.espocrm.com/administrat...re-save-script.

          Comment


          • #6
            Originally posted by lazovic View Post
            Hi rfrancocantero,

            You can use API Before-Save Script:
            Code:
            if (array\length(teamsIds) > 1) {
            recordService\throwBadRequest("You can assign only one team to this record.");
            }
            Go to Administration > Entity Manager > Case > Formula > API Before Save Script and insert this formula script. You can find out more about the API Before-Save Script here:​ https://docs.espocrm.com/administrat...re-save-script.
            Yes! This is perfect!

            Comment

            Working...
            X