mirror of
https://github.com/wekan/wekan.git
synced 2025-12-21 18:00:12 +01:00
Add link card feature to rules
This commit is contained in:
parent
25f85db453
commit
6e3f25c771
4 changed files with 69 additions and 1 deletions
|
|
@ -371,8 +371,29 @@ RulesHelper = {
|
|||
listId,
|
||||
swimlaneId,
|
||||
sort: 0,
|
||||
boardId,
|
||||
boardId
|
||||
});
|
||||
}
|
||||
if (action.actionType === 'linkCard') {
|
||||
const list = Lists.findOne({ title: action.listName, boardId: action.boardId });
|
||||
const card = Cards.findOne({ _id: activity.cardId });
|
||||
let listId = '';
|
||||
let swimlaneId = '';
|
||||
const swimlane = Swimlanes.findOne({
|
||||
title: action.swimlaneName,
|
||||
boardId: action.boardId,
|
||||
});
|
||||
if (list === undefined) {
|
||||
listId = '';
|
||||
} else {
|
||||
listId = list._id;
|
||||
}
|
||||
if (swimlane === undefined) {
|
||||
swimlaneId = Swimlanes.findOne({ title: 'Default', boardId: action.boardId })._id;
|
||||
} else {
|
||||
swimlaneId = swimlane._id;
|
||||
}
|
||||
card.link(action.boardId, swimlaneId, listId);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue