Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-58852

As a Confluence user I would like to include disabled/inactive users in a task report macro

    XMLWordPrintable

Details

    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    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.

      1. Install a Source Editor App available in the Marketplace.
      2. 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>'
        ;
        
      3. In a Confluence page, add a task report macro and configure it targeting any sample, active user.
      4. Edit the same page and now use one of the Source Editor Apps to configure the source of the page.
      5. 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>
        
      6. 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'
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            tmasutti Thiago Masutti
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: