首頁 / 420.8 Automation / 420.8.2
420.8.2・Automation 11%

設定 automation rule

這節是 automation 的主體:組 rule、JSM 專屬元件、auto-resolve/auto-close、smart values,以及啟用、標籤與 AI 產生。

考試佔 11%
官方考綱原文(這一節會考的範圍)
  • Create and configure custom and template-based automation rules.建立自訂與 template 的 rule
  • Configure automation rules to auto-resolve and auto-close tickets.設定自動解決與關閉
  • Configure automation rules to send notifications for status updates, email reminders, and alerts.設定狀態更新、提醒與 alert 通知
  • Configure rule execution components (triggers, conditions, actions, branch rule).設定 trigger、condition、action、branch
  • Implement JSM-specific triggers, conditions, and actions.使用 JSM 專屬元件
  • Use smart values to manipulate lists, strings, dates, numbers, and variables.用 smart values 處理清單、文字、日期、數字、變數
  • Enable and disable rules.啟用與停用 rule
  • Organize rules with labels.用 label 整理 rule
  • Use Atlassian Intelligence to generate automation rules.用 AI 產生 rule
本頁內容
3 分鐘速覽

Trigger → condition → action(+branch)

  1. 建立Space settings → Automation → Create rule(自己組,或從 template、或用 AI 描述產生)。
  2. JSM triggersApproval required、Approval completed、Object created/updated/deleted(global)、SLA threshold breached、Form submitted。
  3. JSM conditionsAffected services、Forms attached、AQL。
  4. JSM actionsApprove/decline request、Add service project customer、Create incident、Create work item with a request type、Edit request type、Lookup/Create/Edit object、Attach forms、Copy forms。
  5. Smart values{{issue.summary}}、{{now.plusBusinessDays(3)}}、{{issue.labels.join(", ")}}、{{#=}}…{{/}}、Create variable。
  6. 管理Enable/disable、labels 分類、rule details(owner、actor、scope)。
資料來源(5)有疑慮時點開看官方原文
組成

一條 rule 的零件

Trigger(只能一個)例:SLA threshold breached、Approval requiredCondition例:Affected services(Tier 1)、JQL、AQL、Forms attachedAction例:Send customized email、Edit request type、Approve/decline、Create objectBranch對相關 work item(linked、sub-task、lookup 結果)各跑一次
Trigger 只能一個;condition 不符就停;action 做事;branch 對相關 work item 各跑一次。
資料來源(4)有疑慮時點開看官方原文
JSM 專屬元件

考綱列出的 trigger、condition、action

類型元件用途與限制
TriggerApproval required/Approval completed需要核准時通知 approver;核准或拒絕後轉 status、通知 customer
TriggerObject created/updated/deletedAssets object 變動時;只能用在 global rule
TriggerSLA threshold breached選 SLA 與「違約前/後多久」;提醒、升級 priority
TriggerForm submitted表單送出時(form 相關步驟只能在 project rule)
ConditionAffected services依 service tier、名稱、依賴服務判斷(ITSM project)
ConditionForms attached檢查是否附了某些表單、表單狀態
ConditionAQLAssets object 或 issue 的 Assets 欄位是否符合 AQL
ActionApprove/decline request自動核准低金額、標準變更
ActionAdd service project customer把 email 加成 customer(可放進 organization);連續呼叫可能要加 Delay
ActionCreate incident建立指定 request type 的 incident;可避免重複建立
ActionCreate work item with a request type用 request type 建單;隱藏欄位不支援
ActionEdit request type改 request type;新 request type 要對應同一個 issue type,否則錯誤
ActionLookup objects/Create object/Edit objectAQL 查最多 100 個 object({{lookupObjects}});建立 object;Edit object 只在 global rule 且 object 是焦點時
ActionAttach forms/Copy forms附表單、從其他 work item 複製表單;只能 project rule
資料來源(5)有疑慮時點開看官方原文
  • Jira automation triggersFlow is run when an object from a specific Assets schema is created, updated, or deleted. This can only be used for global automation flows.
  • Jira automation conditionsNote that Form-related steps are project-specific, so they can’t be configured in Global automation.
  • Jira automation actionsHowever, this means that when your automation flow acts on a work item, the chosen request type must correspond to that work item type.
  • Jira automation actionsSearch for up to 100 Assets objects using AQL. Either enter an AQL query or use the Basic filter to generate a query that can be customized with smart values.
  • Jira automation actionsfor global automation flows and only when an object is the focus of the flow.
常見設定

Auto-resolve、auto-close、提醒

需求TriggerConditionAction
Waiting for customer 3 天沒回就解決Scheduled(每天)JQL:status = "Waiting for customer" AND updated <= -3dTransition to Resolved+Comment(給 customer)
Resolved 7 天後自動 CloseScheduledJQL:status = Resolved AND resolved <= -7dTransition to Closed
Customer 回覆時重開Work item commentedComment 由 reporter/customer、status = Waiting for customerTransition to Waiting for support
SLA 剩 30 分鐘SLA threshold breached(30 min before)—Send Slack/email 給 assignee、Edit priority
狀態更新提醒Work item transitionedTo status = In progressSend customized email(smart values 帶 summary、portal URL)
Template 與 AI

可以從 automation template library 開始,或在 Automation 頁用 Rovo/Atlassian Intelligence 輸入自然語言描述(至少要有 trigger 與 action),預覽後再啟用。

資料來源(5)有疑慮時點開看官方原文
Smart values

處理清單、文字、日期、數字、變數

類型例子結果
文字{{issue.summary.toUpperCase()}}、{{issue.description.abbreviate(100)}}大寫、截斷
清單{{issue.labels.join(", ")}}、{{issue.components.name}}把多值串成文字
日期{{now.plusBusinessDays(3).format("yyyy-MM-dd")}}、{{issue.created.diff(now).days}}3 個工作天後、建立至今天數
數字{{#=}}{{issue.Story points}} * 2{{/}}數學運算
變數Create variable:name=tier、value={{issue.Affected services.tier}} → {{tier}}在後續步驟重複使用
條件{{#if(issue.priority.name.equals("Highest"))}}緊急{{/}}依值輸出不同文字
查詢結果{{lookupObjects}}、{{lookupIssues}}Lookup 動作的結果
資料來源(5)有疑慮時點開看官方原文
管理

啟用、停用、標籤

  • Rule 清單的開關可以 Enable/Disable;停用的 rule 不會觸發,但設定保留。
  • Labels:Automation 頁 Add label(名稱、顏色)→ 把 rule 拖到 label 上;可依 label 篩選。Global 與 project rule 共用 label。
  • Rule details:Name、Description、Owner(錯誤時收 email)、Notify on error、Who can edit(Private/Specific admins/All admins)。
  • Rule settings:Allow rule trigger(能否被其他 rule 觸發)、Scope、Actor。
資料來源(4)・1 點無官方原文有疑慮時點開看官方原文
易錯觀念

考題愛用的錯誤說法

Object created trigger 可以用在 project rule。
Object trigger 只能用在 global rule。
Attach forms 可以設定成 global rule。
Form 相關步驟只能在 project rule。
Edit request type 可以換成任何 request type。
新 request type 要對應同一個 issue type,否則 audit log 出錯。
一條 rule 可以有兩個 trigger。
只能一個;多個事件用 Multiple work item events trigger。
Lookup objects 可以回傳無限多個 object。
最多 100 個。
資料來源(6)有疑慮時點開看官方原文
  • Jira automation triggersFlow is run when an object from a specific Assets schema is created, updated, or deleted. This can only be used for global automation flows.
  • Jira automation actionsForm actions are only space-specific and can’t be configured globally.
  • Jira automation actionsHowever, this means that when your automation flow acts on a work item, the chosen request type must correspond to that work item type.
  • Create flows with Rovo in Jira automationA trigger is what causes a flow to run. Your flow must contain one trigger.
  • Jira automation triggersThe flow will run when one or more selected work item events occur.
  • Jira automation actionsSearch for up to 100 Assets objects using AQL. Either enter an AQL query or use the Basic filter to generate a query that can be customized with smart values.
動手做

實作 Lab:做一條 auto-resolve,用 smart values 除錯

約 30 分鐘HELP 的 project admin;用 Rovo 產生 rule 要站台已啟用 Rovo(Atlassian Intelligence)

第一次做 Lab?先看 Lab 環境準備:用測試站台、準備測試帳號。畫面名稱可能隨 Atlassian 更新而不同,以下以現行畫面為準。

目標:用 Scheduled trigger+JQL 做自動解決,用 Log action 印出 smart values,替 rule 加 label、停用再啟用,最後請 Rovo 產生一條 rule。

這個 Lab 對應的考點

Auto-resolve/auto-close 常用 Scheduled+JQL;smart values 處理文字、清單、日期、數字與變數;labels 只是分類、global 與 project rule 共用;Rovo 產生 rule 至少要描述 trigger 與 action。

準備

  • Cara 有一張 request 在 Waiting for customer,並加上兩個 label(例如 vpn、urgent)。

步驟

  1. 你應該看到:Scheduled trigger 帶 JQL 時,後面的 action 會對查到的每張 work item 執行。正式用時把 -10m 改成 -3d。
  2. 你應該看到:Rule 依序有 trigger、兩個 action。
  3. 你應該看到:Rule 存好並啟用。
  4. 你應該看到:Request 轉成已解決,History 顯示是 Automation for Jira 做的;audit log 展開後看得到 Log action 印出的 labels 字串、天數、3 個工作天後的日期與大寫 summary。
  5. 你應該看到:清單只剩貼了 lab 的 rule。Label 只是分類,不影響執行。
  6. 你應該看到:停用期間它不會被處理,rule 的設定都還在。
  7. 你應該看到:Rovo 產生 trigger+action 的草稿;檢查並補齊細節後才決定要不要 Enable flow(本 Lab 不必啟用)。

試試看:改一個設定,觀察差異

T1在 HELP 的 rule 加 action Edit request type,改成一個 work type 不同的 request type,讓它跑一次。看結果
Audit log 出錯:新的 request type 要對應同一個 work type。
T2在 HELP 的 rule 找 trigger Object trigger(Assets object 建立、更新、刪除)。看結果
通常找不到或不能選:object 相關 trigger 只能用在 global rule。反過來,form 相關的步驟只能用在 project rule。
T3把 Log action 改成 {{#=}}{{issue.created.diff(now).days}} * 24{{/}}。看結果
Audit log 印出換算成小時的數字:數學運算要包在 {{#=}}…{{/}}。
心像錨點:閉上眼睛想一次這個畫面

Audit log 展開的一行:Log action 印著 labels=vpn, urgent/due=三個工作天後的日期。Scheduled+JQL 做 auto-close,Log action 是除錯神器。

收尾

  • 停用「Lab auto-resolve」(或把 JQL 改回 -3d 再保留),刪除 Rovo 預覽產生的草稿。
  • lab label 可保留給 420.8.3 用。
資料來源(4)有疑慮時點開看官方原文
一分鐘腦內整理

讀完了?用這張收攏整節

核、物、時、表Approval、Object、SLA threshold、Form 四種 JSM trigger。
物件看全域、表單看專案Object trigger=global;form 步驟=project。
一條 rule 的零件
  • 一條 rule 只有一個 trigger。
考綱列出的 trigger、condition、action
  • Object trigger 只能 global。
  • Form 元件只能 project rule。
  • Edit request type 要同一個 issue type。
Auto-resolve、auto-close、提醒
  • Auto-close 常用 Scheduled+JQL。
處理清單、文字、日期、數字、變數
  • Create variable+{{變數名}} 重複使用。
  • 數學用 {{#=}}…{{/}}。
啟用、停用、標籤
  • Labels 只是分類,不影響執行。
本節練習

做題

題目載入中…

本教材為原創整理,非 Atlassian 官方出版品;題目皆為原創,不含第三方題庫題幹。考試沿用 project/issue 等用語,現行 Jira Service Management 已改稱 space/work item;customer 端仍叫 request。