設定 automation rule
這節是 automation 的主體:組 rule、JSM 專屬元件、auto-resolve/auto-close、smart values,以及啟用、標籤與 AI 產生。
官方考綱原文(這一節會考的範圍)
- 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
Trigger → condition → action(+branch)
- 建立Space settings → Automation → Create rule(自己組,或從 template、或用 AI 描述產生)。
- JSM triggersApproval required、Approval completed、Object created/updated/deleted(global)、SLA threshold breached、Form submitted。
- JSM conditionsAffected services、Forms attached、AQL。
- 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。
- Smart values{{issue.summary}}、{{now.plusBusinessDays(3)}}、{{issue.labels.join(", ")}}、{{#=}}…{{/}}、Create variable。
- 管理Enable/disable、labels 分類、rule details(owner、actor、scope)。
資料來源(5)有疑慮時點開看官方原文
- Create flows with Rovo in Jira automation
You can use Rovo to generate flows by simply describing the flow you want to create.
- Jira automation triggers
Flow is run when a work item that requires approval is created or updated, or when new approvers are added to a work item.
- Jira automation triggers
Flow is run when an object from a specific Assets schema is created, updated, or deleted.
- Jira automation actions
Define your own smart value, which can be used in other actions and conditions in the same flow.
- Organize your flows with labels
Labels are key words or tags that you can add to flows to categorize, identify, and bookmark your automation flows.
一條 rule 的零件
資料來源(4)有疑慮時點開看官方原文
- Create flows with Rovo in Jira automation
A trigger is what causes a flow to run. Your flow must contain one trigger.
- Use automation steps in a flow
They must be met for your flow to continue running.
- Use automation steps in a flow
They allow you to automate tasks and make changes within your site.
- Use automation steps in a flow
Branches allow you to create a separate execution path of your flow.
考綱列出的 trigger、condition、action
| 類型 | 元件 | 用途與限制 |
|---|---|---|
| Trigger | Approval required/Approval completed | 需要核准時通知 approver;核准或拒絕後轉 status、通知 customer |
| Trigger | Object created/updated/deleted | Assets object 變動時;只能用在 global rule |
| Trigger | SLA threshold breached | 選 SLA 與「違約前/後多久」;提醒、升級 priority |
| Trigger | Form submitted | 表單送出時(form 相關步驟只能在 project rule) |
| Condition | Affected services | 依 service tier、名稱、依賴服務判斷(ITSM project) |
| Condition | Forms attached | 檢查是否附了某些表單、表單狀態 |
| Condition | AQL | Assets object 或 issue 的 Assets 欄位是否符合 AQL |
| Action | Approve/decline request | 自動核准低金額、標準變更 |
| Action | Add service project customer | 把 email 加成 customer(可放進 organization);連續呼叫可能要加 Delay |
| Action | Create incident | 建立指定 request type 的 incident;可避免重複建立 |
| Action | Create work item with a request type | 用 request type 建單;隱藏欄位不支援 |
| Action | Edit request type | 改 request type;新 request type 要對應同一個 issue type,否則錯誤 |
| Action | Lookup objects/Create object/Edit object | AQL 查最多 100 個 object({{lookupObjects}});建立 object;Edit object 只在 global rule 且 object 是焦點時 |
| Action | Attach forms/Copy forms | 附表單、從其他 work item 複製表單;只能 project rule |
資料來源(5)有疑慮時點開看官方原文
- Jira automation triggers
Flow 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 conditions
Note that Form-related steps are project-specific, so they can’t be configured in Global automation.
- Jira automation actions
However, 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 actions
Search 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 actions
for global automation flows and only when an object is the focus of the flow.
Auto-resolve、auto-close、提醒
| 需求 | Trigger | Condition | Action |
|---|---|---|---|
| Waiting for customer 3 天沒回就解決 | Scheduled(每天) | JQL:status = "Waiting for customer" AND updated <= -3d | Transition to Resolved+Comment(給 customer) |
| Resolved 7 天後自動 Close | Scheduled | JQL:status = Resolved AND resolved <= -7d | Transition to Closed |
| Customer 回覆時重開 | Work item commented | Comment 由 reporter/customer、status = Waiting for customer | Transition to Waiting for support |
| SLA 剩 30 分鐘 | SLA threshold breached(30 min before) | — | Send Slack/email 給 assignee、Edit priority |
| 狀態更新提醒 | Work item transitioned | To status = In progress | Send customized email(smart values 帶 summary、portal URL) |
可以從 automation template library 開始,或在 Automation 頁用 Rovo/Atlassian Intelligence 輸入自然語言描述(至少要有 trigger 與 action),預覽後再啟用。
資料來源(5)有疑慮時點開看官方原文
- Jira automation triggers
If you do, actions in this flow will execute on the work items included in the query.
- Jira automation triggers
You can select the SLA to monitor, and the time before or after it has breached to trigger.
- Jira automation triggers
See how to use all of these triggers in our Jira automation template library.
- Create flows with Rovo in Jira automation
To successfully create a flow with Rovo, your flow must at least contain a trigger and an action.
- Create flows with Rovo in Jira automation
Select Preview flow to see a preview of the flow that was generated.
處理清單、文字、日期、數字、變數
| 類型 | 例子 | 結果 |
|---|---|---|
| 文字 | {{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)有疑慮時點開看官方原文
- Automation smart values - text fields
Abbreviates the text string to the defined number of characters and adds "..." to the end.
- Automation smart values - lists
Iterates over a list and prints out items separated by the given characters.
- Automation smart values - date and time
Returns the amount of time between date1 and date2, in the unit specified.
- Automation smart values - math expressions
To use a math expression, you need to use {{#=}}
- Jira automation actions
Define your own smart value, which can be used in other actions and conditions in the same flow.
啟用、停用、標籤
- 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 點無官方原文有疑慮時點開看官方原文
- 找不到官方原文:停用的 rule 設定保留沒有找到官方原文。
- Organize your flows with labels
Once a label has been added, drag and drop a flow on the label to apply it.
- Organize your flows with labels
You can use the same label across both global and space flows.
- What are flow details and settings?
If a flow runs and results in an error, the owner will be notified by email.
- What are flow details and settings?
If selected, your flow can be triggered by other automation flows.
考題愛用的錯誤說法
資料來源(6)有疑慮時點開看官方原文
- Jira automation triggers
Flow 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 actions
Form actions are only space-specific and can’t be configured globally.
- Jira automation actions
However, 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 automation
A trigger is what causes a flow to run. Your flow must contain one trigger.
- Jira automation triggers
The flow will run when one or more selected work item events occur.
- Jira automation actions
Search 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 除錯
第一次做 Lab?先看 Lab 環境準備:用測試站台、準備測試帳號。畫面名稱可能隨 Atlassian 更新而不同,以下以現行畫面為準。
目標:用 Scheduled trigger+JQL 做自動解決,用 Log action 印出 smart values,替 rule 加 label、停用再啟用,最後請 Rovo 產生一條 rule。
Auto-resolve/auto-close 常用 Scheduled+JQL;smart values 處理文字、清單、日期、數字與變數;labels 只是分類、global 與 project rule 共用;Rovo 產生 rule 至少要描述 trigger 與 action。
準備
- Cara 有一張 request 在 Waiting for customer,並加上兩個 label(例如 vpn、urgent)。
步驟
- 你應該看到:Scheduled trigger 帶 JQL 時,後面的 action 會對查到的每張 work item 執行。正式用時把 -10m 改成 -3d。
- 你應該看到:Rule 依序有 trigger、兩個 action。
- 你應該看到:Rule 存好並啟用。
- 你應該看到:Request 轉成已解決,History 顯示是 Automation for Jira 做的;audit log 展開後看得到 Log action 印出的 labels 字串、天數、3 個工作天後的日期與大寫 summary。
- 你應該看到:清單只剩貼了 lab 的 rule。Label 只是分類,不影響執行。
- 你應該看到:停用期間它不會被處理,rule 的設定都還在。
- 你應該看到:Rovo 產生 trigger+action 的草稿;檢查並補齊細節後才決定要不要 Enable flow(本 Lab 不必啟用)。
試試看:改一個設定,觀察差異
T1在 HELP 的 rule 加 action Edit request type,改成一個 work type 不同的 request type,讓它跑一次。看結果
T2在 HELP 的 rule 找 trigger Object trigger(Assets object 建立、更新、刪除)。看結果
T3把 Log action 改成 {{#=}}{{issue.created.diff(now).days}} * 24{{/}}。看結果
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)有疑慮時點開看官方原文
- Jira automation triggers:Scheduled
You can also choose to enter a JQL query. If you do, actions in this flow will execute on the work items included in the query.
- Jira automation actions:Log action
This action is useful when testing smart values, and debugging flows.
- Organize rules with labels
Once a label has been added, drag and drop a flow on the label to apply it.
- Create flows with Rovo
To successfully create a flow with Rovo, your flow must at least contain a trigger and an action.
讀完了?用這張收攏整節
- 一條 rule 只有一個 trigger。
- Object trigger 只能 global。
- Form 元件只能 project rule。
- Edit request type 要同一個 issue type。
- Auto-close 常用 Scheduled+JQL。
- Create variable+{{變數名}} 重複使用。
- 數學用 {{#=}}…{{/}}。
- Labels 只是分類,不影響執行。
做題
題目載入中…
本教材為原創整理,非 Atlassian 官方出版品;題目皆為原創,不含第三方題庫題幹。考試沿用 project/issue 等用語,現行 Jira Service Management 已改稱 space/work item;customer 端仍叫 request。