Răsfoiți Sursa

Fix bugs with customFields identified in Issue #3574

Fixed bug with the reference to the customFieldValue in the cards.js

Activity Insert was not being passed the listId, swimlaneId which was required when building the webhook text string.

Added customField and customFieldValue as default values for the webhook msgs. There is no good reason to exclude these (they will only be included when changing a customField anyway). Updated the docker-compose comment to reflect this change.
n8ores 4 ani în urmă
părinte
comite
950e41e8f7
4 a modificat fișierele cu 6 adăugiri și 4 ștergeri
  1. 1 1
      docker-compose.yml
  2. 1 3
      models/activities.js
  3. 2 0
      models/cards.js
  4. 2 0
      server/notifications/outgoing.js

+ 1 - 1
docker-compose.yml

@@ -309,7 +309,7 @@ services:
       #- TRUSTED_URL=https://intra.example.com
       #-----------------------------------------------------------------
       # ==== OUTGOING WEBHOOKS ====
-      # What to send to Outgoing Webhook, or leave out. Example, that includes all that are default: cardId,listId,oldListId,boardId,comment,user,card,commentId .
+      # What to send to Outgoing Webhook, or leave out. If commented out the default values will be: cardId,listId,oldListId,boardId,comment,user,card,commentId,swimlaneId,customerField,customFieldValue
       #- WEBHOOKS_ATTRIBUTES=cardId,listId,oldListId,boardId,comment,user,card,commentId
       #-----------------------------------------------------------------
       # ==== Debug OIDC OAuth2 etc ====

+ 1 - 3
models/activities.js

@@ -231,9 +231,7 @@ if (Meteor.isServer) {
     if (activity.customFieldId) {
       const customField = activity.customField();
       params.customField = customField.name;
-      params.customFieldValue = Activities.findOne({
-        customFieldId: customField._id,
-      }).value;
+      params.customFieldValue = activity.value;
     }
     // Label activity did not work yet, unable to edit labels when tried this.
     //if (activity.labelId) {

+ 2 - 0
models/cards.js

@@ -2112,6 +2112,8 @@ function cardCustomFields(userId, doc, fieldNames, modifier) {
             activityType: 'setCustomField',
             boardId: doc.boardId,
             cardId: doc._id,
+            listId: doc.listId,
+            swimlaneId: doc.swimlaneId
           };
           Activities.insert(act);
         }

+ 2 - 0
server/notifications/outgoing.js

@@ -61,6 +61,8 @@ if (Meteor.isServer) {
     'card',
     'commentId',
     'swimlaneId',
+    'customField',
+    'customFieldValue'
   ];
   const responseFunc = data => {
     const paramCommentId = data.commentId;