I’m looking at using Nextcloud Flow to automatically add a Card to a deck/stack when a file is tagged.
From what I can find, the only way to do that would be to create a script that is run when a file is tagged. Unfortunately I have limited-to-no programming knowledge but willing to learn.
I think it can be achieved by quering the Deck API through cURL. It is quite well documented. If board and stack ID are known and always the same, it shouldn’t be too hard.
I will test it myself and post some example commands here.
I think a flow integration would definitiely be interesting. Could you describe your use case a bit more in detail, especially what the newly created card should contain, assuming you have the file as input data.
My use case is for an Architectural firm. So for example, Construction manager sends a request for information (RFI) pdf via email, the RFI.pdf is saved in the Project/RFI folder on Nextcloud with “RFI & Review” tags added. This then automatically adds a card under Project Deck/Todo Stack with a link to the RFI.pdf in question.
(set a number from the results list of the previous command for {boardId})
Now that you know board ID and stack ID, you can create a new card in the selected board/stack
curl -X POST -u username:password 'https://cloud.example.com/index.php/apps/deck/api/v1.0/boards/{boardId}/stacks/{stackId}/cards' -d 'title=Card title goes here' -H "OCS-APIRequest: true"
The ID of the newly created card is returned to you upon creation "Id":xxx
{"title":"Card title goes here","description":"","stackId":297,"type":"plain","lastModified":1583590242,"lastEditor":null,"createdAt":1583590242,"labels":null,"assignedUsers":null,"attachments":null,"attachmentCount":null,"owner":"testuser","order":999,"archived":false,"duedate":null,"deletedAt":0,"commentsUnread":0,"id":871,"overdue":0}