Link the newly created Confluence page to Jira issue using automation

Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

This document includes an internal API endpoint and this information is provided as-is, we're unable to directly assist unless there is a bug or documentation error. However, we can definitely support you if a public REST API call isn't working as expected. See Atlassian Support Offerings for additional information.

Summary

Currently, after using the Create confluence page action, there's no action to link the newly created page to the issue. As a workaround for the feature request AUTO-20 - Getting issue details... STATUS , we can use an API endpoint to make this link.

Solution

The same solution applies when a more complex page is created using a Confluence endpoint. Below are examples for both cases.

All API calls use the Basic authorization.

Using API

  1. Create the confluence page with this endpoint using the Send web request action: 

    POST https://<your-site>.atlassian.net/wiki/rest/api/content

    Sample payload:

    {
      "title": "API - {{issue.summary}}",
      "type": "page",
      "space": {
        "key": "<key>",
        "name": "<name>",
    }
    }

    Do not forget to mark the option "Delay execution of subsequent rule actions until we've received a response for this web request" to ensure the {{webResponse}} smart value is available.

  2. Then, call the endpoint below to link the page and the issue using the smart value {{webResponse.body._links.webui}} from the response body of the call above:

    POST https://<your-site>.atlassian.net/rest/confluenceIssueLink/1/confluence?issueId={{issue.id}}&pageUrl=https://<your-site>.atlassian.net/wiki/{{webResponse.body._links.webui}}

Using the automation action

  1. Create the page using the Create confluence page action.
  2. Then, call the endpoint below to link the page and the issue using the smart value mentioned here:

    POST https://<your-site>.atlassian.net/rest/confluenceIssueLink/1/confluence?issueId={{issue.id}}&pageUrl={{createdPage.url}}

Last modified on Oct 30, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.