Forms: Automation to Change the Visibility of Jira Forms on Issue

お困りですか?

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

コミュニティに質問

アトラシアン社外秘

この記事は未検証なのでお客様と共有できません。

要約

This article discusses the implementation of automation to modify the accessibility of Forms associated with a Jira Issue, allowing them to be either accessible to external or restricted for internal.

環境

Jira Service Management Cloud
Jira Automation Cloud

ソリューション

(info) We will use Rest API Calls to view the visibility of Forms attached to the Issue and then change the visibility to either external or internal.

Use the steps below to configure a built-in automation rule 


Create an API Key for your admin account

Log in to https://id.atlassian.com/manage-profile/security/api-tokens.

Click Create API token.
From the dialogue that appears, enter a memorable and concise Label for your token and click Create.
Click Copy to clipboard, then paste the token to your script, or elsewhere to save:
Check Current Visibility of FORM
  • Go to Project Settings > Automation > Create Rule
  • One could either configure an Automated Trigger or have a Manual Trigger; as stated in Jira automation triggers, for the purpose of this example we will useManual Trigger.
  • Select "Send Web Request " under "Add an Action" 


    Headers ( Optional )

    認証

    Basic  <Base64-ApiKey>

    X-ExperimentalAPIopt-in

    BASE64 encode the string.

        • Linux/Unix/MacOS:

          echo -n user@example.com:api_token_string | base64

  • HTTP Method: GET 
  • Check: Delay execution of subsequent rule actions until we've received a response for this web request
  • (Optional) Add Audit Log to Capture Issue Key: {{issue}}
  • (Optional) Add Audit log to capture Current Visibility of FORM from the Web Response:  {{webResponse.body.internal}}

    [ (info) If true then Visibility is Internal, if False Visibility is External ]
Change Visibility to Internal
  • If there are multiple Forms, we need to run the  API against each Form ID and pass it in the API to change the Visibility 
  • Create a variable (e.g., {{FORM}}) with the following structure:

    {{webResponse.body.id}}
  • Create a Branching For Each condition ; For Each {{FORM}}
  • Select "Send Web Request " under "Add an Action" 


    Headers ( Optional )

    認証

    Basic  <Base64-ApiKey>

    X-ExperimentalAPIopt-in

    BASE64 encode the string.

      • Linux/Unix/MacOS:

        echo -n user@example.com:api_token_string | base64

  • HTTP Method: PUT 
  • Check: Delay execution of subsequent rule actions until we've received a response for this web request
  • (Optional) Add a audit log to capture the HTTP Response Status: {{webResponse.status}}
Change Visibility to External
  • If there are multiple Forms, we need to run the API against each Form ID and pass it in the API to change the Visibility 
  • Create a variable (e.g., {{FORM}}) with the following structure:

    {{webResponse.body.id}}
  • Create a Branching For Each condition ; For Each {{FORM}}
  • Select "Send Web Request " under "Add an Action" 


    Headers ( Optional )

    認証

    Basic  <Base64-ApiKey>

    X-ExperimentalAPIopt-in

    BASE64 encode the string.

      • Linux/Unix/MacOS:

        echo -n user@example.com:api_token_string | base64

  • HTTP Method: PUT 
  • Check: Delay execution of subsequent rule actions until we've received a response for this web request
  • (Optional) Add a audit log to capture the HTTP Response Status: {{webResponse.status}}





To get Cloud ID :

Go to : https://admin.atlassian.com/
Click on your "site" of interest and you will get the Cloud id in the URL
Resulting URL Example: https://admin.atlassian.com/s/<Your_cloud_id>users

最終更新日 2023 年 9 月 8 日

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

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