JSM 的 JQL
JSM 在一般 JQL 之外,多了 SLA、approval、organization、entitlement 的函數。考你挑對函數、存成 filter 分享,以及用 AI 協助寫 JQL。
官方考綱原文(這一節會考的範圍)
- Create JQL queries with JSM-specific functions (such as approved, breached, entitlement product).用 JSM 專屬函數寫 JQL
- Save JQL queries as filters and share with users.存成 filter 並分享
- Utilize Atlassian Intelligence to assist with creating JQL queries.用 Atlassian Intelligence 協助寫 JQL
JSM 專屬的 JQL 函數
- SLAbreached()、everBreached()、completed()、running()、paused()、withinCalendarHours()、elapsed()、remaining()。
- Approvalapproved()、pending()、approver(user)、pendingBy(user)、pendingApprovalBy(user)、myPending()、myPendingApproval()。「還沒按」要用 pendingApprovalBy/myPendingApproval。
- Customer 與 organizationorganizationMembers("Acme")、customerDetail()、organizationDetail()。
- Entitlemententitlement in entitlementProduct("Acme Widget")、entitlementDetail("Support Level", "Gold")。
- 存成 filter 分享Save filter → 分享給 group、project、project role;filter 可給 dashboard gadget 用。
- AI 寫 JQL在搜尋列用自然語言描述,Atlassian Intelligence(Rovo)轉成 JQL。
資料來源(5)有疑慮時點開看官方原文
- Write JQL queries for SLAs
This filters out work items where the last SLA cycle has failed to meet its target goal.
- JQL functions
Search for all requests that have an approval with a final decision of approved.
- JQL functions
Search for all requests sent by the members of an organization.
- JQL functions
To use this JQL function, turn on Customer service management and Products and entitlements on the Features page in Space settings.
- Use Rovo to search for work items
You can tell Rovo to search for work items in simple language instead of coming up with complex JQL queries.
JSM 常用 JQL 函數
| 函數 | 欄位 | 找什麼 | 例子 |
|---|---|---|---|
| breached() | SLA | 最近一個 cycle 違約 | "Time to resolution" = breached() |
| everBreached() | SLA | 曾經違約 | "Time to first response" = everBreached() |
| paused()/running()/completed() | SLA | 暫停中/計時中/已完成 | "Time to resolution" = paused() |
| withinCalendarHours() | SLA | 依 calendar 正在計時(不是被條件暫停) | "Time to resolution" = withinCalendarHours() |
| remaining("2h")、elapsed("30m") | SLA | 剩餘或已經過的時間 | "Time to resolution" < remaining("2h") |
| approved() | Approval 欄位 | 最終決定是核准 | approvals = approved() |
| pending() | Approval 欄位 | 還在等核准 | approvals = pending() |
| approver(u) | Approval 欄位 | u 是進行中或已完成 step 的 approver,不論是否已決定 | approvals = approver(jsmith) |
| pendingBy(u) | Approval 欄位 | u 是進行中 step 的 approver;u 可能已經按過(step 還在等其他人) | approvals = pendingBy(jsmith) |
| pendingApprovalBy(u) | Approval 欄位 | u 是進行中 step 的 approver,而且還沒核准或拒絕 | approvals = pendingApprovalBy(jsmith) |
| myPending()/myPendingApproval() | Approval 欄位 | 同上兩個,對象是目前使用者;等我按的用 myPendingApproval() | approvals = myPendingApproval() |
| organizationMembers("Acme") | Reporter 等 | Acme 成員提的 request | reporter in organizationMembers("Acme") |
| entitlementProduct("X") | Entitlement | 與某 product entitlement 相關 | entitlement in entitlementProduct("Acme Widget") |
| entitlementDetail(f, v) | Entitlement | Entitlement 某細節符合 | entitlement in entitlementDetail("Support Level", "Gold") |
customerDetail、organizationDetail、entitlement 相關函數要在 Features 頁開啟 Customer service management(以及 Products and entitlements)。
Q1找出等 Mia 核准、她還沒按的 request?看答案
Q2breached() 與 everBreached() 差在哪?看答案
資料來源(7)有疑慮時點開看官方原文
- JQL functions:pendingApprovalBy()
Search for requests where any specified user is the approver for a pending approval step and is yet to approve or decline the approval.
- JQL functions:pendingBy()
Search for requests where any specified user is an approver for a pending approval step, and may or may not have already approved or declined the request.
- JQL functions
Returns work items that whose most recent SLA has missed its goal.
- JQL functions
Returns work items that have missed one of their SLA goals.
- JQL functions
Search for requests where any specified user is an approver for a pending or completed approval step, and may or may not have already approved or declined the approval.
- JQL functions
Search for requests where the current user is the approver for a pending approval step and is yet to approve or decline the approval.
- JQL functions
To use this JQL function, enable Customer service management on the Features page.
存成 filter、分享、用 AI 寫
- 寫 JQL搜尋 → 切到 JQL;或用自然語言描述讓 Atlassian Intelligence 產生 JQL,再檢查結果。
- 存成 filterSave filter → 命名。
- 分享Filter details → 分享給 group、project、project role 或站上所有人(需 Share dashboards and filters 全域權限)。被分享的人仍只看得到自己有權限的 work item。
- 用在其他地方Dashboard gadget、filter subscription、automation 的 JQL 條件、queue 的進階篩選。
資料來源(4)・1 點無官方原文有疑慮時點開看官方原文
- 找不到官方原文:Filter 用在 automation 與 queueFilter 文件只寫到 dashboard gadget 與 subscription;其他用途屬整理。
- Use Rovo to search for work items
Rovo in Jira can translate what you type into a Jira Query Language (JQL) code which quickly searches for the work items you’re looking for.
- Save your search as a filter
Jira's powerful work item search functionality is enhanced by the ability to save searches, called filters, for later use.
- Manage filters
You can share filters you've created or you have permission to edit with other users via user groups, spaces, and space roles.
- What are global permissions, and what do they control?
Users with this permission can share dashboards and filters with other users, provided they have permission to view it.
考題愛用的錯誤說法
資料來源(4)・1 點無官方原文有疑慮時點開看官方原文
- 找不到官方原文:被分享者只看得到自己有 Browse 權限的 work item官方 filter 文件沒有直接寫明;依 Browse 權限的運作推論。
- Write JQL queries for SLAs
This filters out work items where the last SLA cycle has failed to meet its target goal.
- JQL functions
Returns work items that have missed one of their SLA goals.
- JQL functions
Search for requests where any specified user is an approver for a pending or completed approval step, and may or may not have already approved or declined the approval.
- JQL functions
To find work items that are paused because they are outside calendar hours, use withinCalendarHours().
實作 Lab:用 JSM 函數找出 Acme 與待核准的單
第一次做 Lab?先看 Lab 環境準備:用測試站台、準備測試帳號。畫面名稱可能隨 Atlassian 更新而不同,以下以現行畫面為準。
目標:在 HELP 上實際跑 organization、approval、SLA 三類 JSM 專屬 JQL 函數,比較相似函數的差別,存成 filter 分享,再請 AI 幫忙寫一條。
organizationMembers() 找某 organization 成員提的單;approver() 不論 approval step 是否已完成,pendingApprovalBy() 只列出還在等他按的(pendingBy() 則可能包含他已按、但 step 還在等別人的);breached() 看最近一個 cycle,everBreached() 看曾經;分享 filter ≠ 給看 work item 的權限。
準備
- HELP 至少有:Cara 提的 2 張、Dan 提的 1 張;420.4.4 留下的 approval request(一張 Ana 已核准、一張等 Ana 核准)。沒有就先建。
- 把其中一張 Cara 的 request 轉到 Waiting for customer。
步驟
- 你應該看到:只列出 Cara 的 request,沒有 Dan 的:Dan 不屬於 Acme Corp。
- 你應該看到:第一條是還在等核准的那張;第二條是 Ana 已核准的那張。
- 你應該看到:approver(Ana) 兩張都列出(含已完成的 approval step);pendingApprovalBy(Ana) 只列出還在等她按的那張。
- 你應該看到:Ana 看到等她核准、她還沒按的那張;換 Leo 跑同一句,結果是空的。
- 你應該看到:Waiting for customer 的那張通常出現在 paused()(被 SLA 的 pause 條件停住),其他未解決的在 running();實際依 HELP 的 SLA 設定。
- 你應該看到:測試站台多半還沒有違約的單,結果是空的也正常。記住差別:breached() 看最近一個 cycle,everBreached() 只要曾經違約就算。
- 你應該看到:Kim 看得到 filter;結果只包含 Kim 有 Browse 權限的 work item。
- 你應該看到:AI 產生一條 JQL;檢查它有沒有用 organizationMembers() 與 resolution = Unresolved,結果和你手寫的是否一致。AI 產生的要自己驗證。
試試看:改一個設定,觀察差異
T1把 Kim 從 HELP 的 Service Desk Team role 暫時移除,Kim 再打開分享給她的 filter。看結果
T2跑 organization in organizationDetail("Region", "APAC") 這類 customerDetail/organizationDetail 查詢。看結果
T3把步驟 5 的 paused() 換成 withinCalendarHours(),在下班時間跑一次。看結果
JQL 搜尋框:approvals = pendingApprovalBy(Ana) 只剩一張,approver(Ana) 有兩張。破、曾破、停、跑、完;ApprovalBy 才是還沒按。
收尾
- 刪除或保留「Lab Acme 的 request」filter(420.7.2 可沿用)。
- 把那張 request 從 Waiting for customer 轉回原狀態。
資料來源(4)有疑慮時點開看官方原文
- JQL functions:organizationMembers()
Search for all requests sent by the members of an organization.
- JQL functions:approver()
Search for requests where any specified user is an approver for a pending or completed approval step
- JQL functions:myPendingApproval()
Search for requests where the current user is the approver for a pending approval step and is yet to approve or decline the approval.
- Write JQL queries for SLAs
This filters out work items where the last SLA cycle has failed to meet its target goal.
讀完了?用這張收攏整節
- breached=最近一次;everBreached=曾經。
- pendingApprovalBy=還沒按;pendingBy=step 還在進行(可能已按);approver=不論是否已決定。
- 分享 filter ≠ 給看 work item 的權限。
做題
題目載入中…
本教材為原創整理,非 Atlassian 官方出版品;題目皆為原創,不含第三方題庫題幹。考試沿用 project/issue 等用語,現行 Jira Service Management 已改稱 space/work item;customer 端仍叫 request。