Link the newly created Confluence page to Jira issue using automation

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。

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.

要約

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.

ソリューション

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.

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}}

最終更新日: 2024 年 10 月 30 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.