Details
-
Suggestion
-
Resolution: Unresolved
-
None
Description
Problem Definition
When users are disabled in the Confluence user directory we are unable to search them because they are not active in the Lucene index.
Because of this, I am unable to create a task report macro targeting disabled users, since they won't appear in the Assigned to search box when configuring the macro.
Suggested Solution
Make it possible to search for disabled users when configuring the task report macro.
Workaround
The workaround below is valid if you need to have a page with a task report macro targeting a disabled user.
- Install a Source Editor App available in the Marketplace.
- Suggested Apps are Confluence Source Editor (unsupported) or Source Editor for Confluence (supported by Mohami).
- In the Confluence database, get the user_key of the target user – this key will be used later.
select user_key from user_mapping where username='<target username>' ;
- In a Confluence page, add a task report macro and configure it targeting any sample, active user.
- Edit the same page and now use one of the Source Editor Apps to configure the source of the page.
- Search for the macro definition, which might be similar to the below.
<ac:structured-macro ac:macro-id="66f9a8c1-6618-4a87-ad65-b814a0d17a82" ac:name="tasks-report-macro" ac:schema-version="1"> <ac:parameter ac:name="spaces">SPACE002</ac:parameter> <ac:parameter ac:name="assignees"> <ri:user ri:userkey="4028808d6d1bacb9016d1bb051830001"/> </ac:parameter> </ac:structured-macro>
- Where you see <ri:user ri:userkey="<sample user key>"/>, change the key with the one you retrieved from the database and apply the changes to the page.
- If you want to add more users, simply add more <ri:user ri:userkey="<sample user key>"/> tags inside the <ac:parameter ac:name="assignees">.
If you want a list of pages with tasks assigned to a target user, without the need to have a task report macro, you may rely on a REST API call as below.
You may run this API as a Confluence user, instead of an admin, but you may not have access to all pages on which the target user had tasks assigned.
CONFLUENCE_BASE_URL=<Confluence Base URL> ADMIN_USERNAME=<Confluence admin username> ADMIN_PASSWORD=<Confluence admin password> TARGET_USERNAME=<target username> NUM_TASKS=<max number of tasks in the list> curl -u ${ADMIN_USERNAME}:${ADMIN_PASSWORD} -H 'Accept: application/json' ${CONFLUENCE_BASE_URL}'/rest/inlinetasks/1/task-report/?pageIndex=0&pageSize='${NUM_TASKS}'&reportParameters=%7B%22columns%22%3A%5B%22description%22%2C%22duedate%22%2C%22assignee%22%2C%22location%22%5D%2C%22spaces%22%3A%5B%5D%2C%22pages%22%3A%5B%5D%2C%22duedateFrom%22%3Anull%2C%22duedateTo%22%3Anull%2C%22createdateFrom%22%3Anull%2C%22createdateTo%22%3Anull%2C%22assignees%22%3A%5B%22'${TARGET_USERNAME}'%22%5D%2C%22creators%22%3A%5B%5D%2C%22status%22%3Anull%2C%22labels%22%3A%5B%5D%2C%22pageSize%22%3A20%2C%22sortColumn%22%3A%22assignee%22%2C%22reverseSort%22%3Afalse%7D'