Hello,
I'm trying to create a Confluence Automation flow that checks the numbers of tasks that are incomplete.
Has anyone has figure out how to do this? On the web I found smart values like {{tasks}} or
Hi @Pedro Garzon
What is the context / scope of your check?
I do not believe the first approach provides any page information. The second one with the REST API will have the page ID values with each task.
Kind regards,Bill
I have a page in confluence with 5 actions. I would like to create an automation that archives the page when the 5 actions are complete.
I will try again but last time I tried a Task Branch Confluence did not recognized the smart value {{task.size}} = 0. I do not recognize the "|0}}" do you know where in the confluence documentation I can find the reference for it?
Thank you
Please note for the Task Branch, the smart value after the branch is plural: {{tasks}}
And this will count all possible tasks which the rule's actor / user can access...not just the ones for the page. To only count for one page, I believe the REST API technique and filtering on the page id is required.
Finally, the |0 part provides a default value of 0 when the smart value does not return anything (i.e., it is a null value). That syntax is listed in the Jira smart value documentation rather than in the Confluence information:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#Default-values
Pedro, it looks like Bill's right that a Task branch can't be limited to one page, and Atlassian Support said the same in another thread. Atlassian's automation docs do list {{page}} as available from the Task status changed trigger when the task is on a page, so that might work instead. Going by the docs, you'd first set that trigger to Complete, then add a condition on your page's title or a label, otherwise the rule would archive every page in its scope once its tasks are finished. Next comes Send web request with a GET to https://yoursite.atlassian.net/wiki/api/v2/tasks?page-id={{page.id}}&status=incomplete, an Authorization header using an API token, and the option to wait for the response. After that, a smart values condition that {{webResponse.body.results.size|0}} equals 0, then the Archive page action. I haven't tested this, so it's worth trying on a test page first.
It looks like you're new here. Sign in or register to get started.