Jira Service Management automation fails to trigger actions

お困りですか?

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

コミュニティに質問

プラットフォームについて: Server、Data Center、および Cloud (状況に応じる) - この記事はアトラシアンのサーバーおよびデータセンター プラットフォーム向けに記載されていますが、Atlassian Cloud のお客様も記事の内容を利用できる可能性があります。この記事で説明されている手順の実施が役立つと考えられる場合、アトラシアン サポートにお問い合わせのうえ、この記事を紹介してください。

問題

Automation has been configured and the "THEN" action does not seem to be triggered or doing anything. Checking on the "Audit Log" (available at Jira Service Management 3.3), it only shows "!" or exclamation mark. For example:

There is no Error or related stack trace could be found in the logs.

診断

We will check the failing action by using REST API to get the details. You can use the software below that will help on doing REST API Calls:

First, check the ID of the Automation that has failing condition by navigating to Affected Project > Project Administration > Automation > View Log. Take note of the URL, for example:

<Jira Base URL>/servicedesk/admin/<ProjectKey>/automation/log/1

Here, we could get that the Automation ID=1 from the URL.

Then, purposely trigger the Automation by making a ticket meet the "IF" condition in order to make it fail and run the following REST CALL below:

curl -D- -u <admin_username>:<admin_password> -X GET <Jira Base URL>/rest/servicedesk/automation/1/audit/ruleset/<AutomationID>?issueKeyFilter=<issue key>&hideSuccessfulExecutions=true
 
=== Example ===
curl -D- -u admin:admin -X GET http://localhost:8724/j724/rest/servicedesk/automation/1/audit/ruleset/1?issueKeyFilter=ISD-2&hideSuccessfulExecutions=true

This will show all the Executions that failed related to that Issue Key for that specific Automation. An example of the REST CALL above is:

{
  "ruleName": "Close issue when linked issue has resolution",
  "executions": [
    {
      "id": 18821,
      "ruleId": 79,
      "issueKey": "AIRDESK-1149",
      "startTime": 1493719886033,
      "finishTime": 1493719886095,
      "formattedStartTime": "May 2, 2017 12:11:26 PM",
      "executedBy": "qateam",
      "outcome": {
        "outcome": "Rule was not executed because an if condition was not met",
        "outcomeCode": "NOT_EXECUTED",
        "hasError": false
      }
    },
    {
      "id": 18326,
      "ruleId": 76,
      "issueKey": "AIRDESK-1149",
      "startTime": 1492507498216,
      "finishTime": 1492507498726,
      "formattedStartTime": "April 18, 2017 11:24:58 AM",
      "executedBy": "qateam",
      "outcome": {
        "outcome": "Failed to execute rule successfully",
        "outcomeCode": "ERROR",
        "hasError": true
      }
    }
}

With the Result above, take note of the "outcomeCode" : "ERROR" and "hasError" : true where it means that there is an issue in executing the RULE. Just like before, we take the "id" : 18326  to be used for the next REST CALL which is:

<Jira Base URL>/rest/servicedesk/automation/1/audit/execution/<ID_from_above>
 
=== Example ===
<Jira Base URL>/rest/servicedesk/automation/1/audit/execution/18326

With the REST CALL above, it will show the details on how it fails to trigger the Condition. For example, below is the result of the Example REST CALL above:

{
  "whens": [
    {
      "error": false,
      "status": "NOT_EXECUTED",
      "displayData": "A linked issue is transitioned"
    }
  ],
  "ifThens": [
    {
      "ifConditions": [
        {
          "error": false,
          "status": "SUCCESS",
          "displayData": "Linked issue matches: resolution = Done"
        },
        {
          "error": false,
          "status": "SUCCESS",
          "displayData": "Link type matches: is caused by"
        }
      ],
      "thenActions": [
        {
          "error": false,
          "status": "SUCCESS",
          "displayData": "Add comment: Hello,\nYour request is now resolved. Please check if resolution works for you!\n\n_This is automatic message to notify you about the progress. Please do not respond to it. Your comments are always welcomed though. Please login to your Service Management account and place comment on any open request you see in your dashboard._ \n\nSincerely \nYour Service Desk Team."
        },
        {
          "error": false,
          "status": "ERROR",
          "displayData": "Transition issue: Resolve Issue",
          "outcomeMessage": "Issue transition validation failed\nassignee: User 'collaborator.one' cannot be assigned issues.\n"
        }
      ]
    },
    {
      "ifConditions": [
        {
          "error": false,
          "status": "NOT_EXECUTED",
          "displayData": "Linked issue matches: resolution = Done"
        },
        {
          "error": false,
          "status": "NOT_EXECUTED",
          "displayData": "Link type matches: causes"
        }
      ],
      "thenActions": [
        {
          "error": false,
          "status": "NOT_EXECUTED",
          "displayData": "Add comment: Hello,\nYour request is now resolved. Please check if resolution works for you!\n\n_This is automatic message to notify you about the progress. Please do not respond to it. Your comments are always welcomed though. Please login to your Service Management account and place comment on any open request you see in your dashboard._ \n\nSincerely \nYour Service Desk Team."
        },
        {
          "error": false,
          "status": "NOT_EXECUTED",
          "displayData": "Transition issue: Resolve Issue"
        }
      ]
    }
  ]
}

We take any of the Conditions or Actions that has its "status": "ERROR" where in this case it is due to the User does not have the permission to be the Assignee of the ticket.


説明Automation has been configured and the "THEN" action does not seem to be triggered or doing anything. Checking on the "Audit Log" (available at Jira Service Management 3.3), it only shows "!" or exclamation mark.
製品Jira
プラットフォームクラウド
最終更新日 2020 年 11 月 23 日

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

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