首頁 / 420.7 報表 / 420.7.1
420.7.1・Reporting 7%

JSM 的 JQL

JSM 在一般 JQL 之外,多了 SLA、approval、organization、entitlement 的函數。考你挑對函數、存成 filter 分享,以及用 AI 協助寫 JQL。

考試佔 7%
官方考綱原文(這一節會考的範圍)
  • 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
本頁內容
3 分鐘速覽

JSM 專屬的 JQL 函數

  1. SLAbreached()、everBreached()、completed()、running()、paused()、withinCalendarHours()、elapsed()、remaining()。
  2. Approvalapproved()、pending()、approver(user)、pendingBy(user)、pendingApprovalBy(user)、myPending()、myPendingApproval()。「還沒按」要用 pendingApprovalBy/myPendingApproval。
  3. Customer 與 organizationorganizationMembers("Acme")、customerDetail()、organizationDetail()。
  4. Entitlemententitlement in entitlementProduct("Acme Widget")、entitlementDetail("Support Level", "Gold")。
  5. 存成 filter 分享Save filter → 分享給 group、project、project role;filter 可給 dashboard gadget 用。
  6. AI 寫 JQL在搜尋列用自然語言描述,Atlassian Intelligence(Rovo)轉成 JQL。
資料來源(5)有疑慮時點開看官方原文
  • Write JQL queries for SLAsThis filters out work items where the last SLA cycle has failed to meet its target goal.
  • JQL functionsSearch for all requests that have an approval with a final decision of approved.
  • JQL functionsSearch for all requests sent by the members of an organization.
  • JQL functionsTo 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 itemsYou 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 成員提的 requestreporter in organizationMembers("Acme")
entitlementProduct("X")Entitlement與某 product entitlement 相關entitlement in entitlementProduct("Acme Widget")
entitlementDetail(f, v)EntitlementEntitlement 某細節符合entitlement in entitlementDetail("Support Level", "Gold")
前提

customerDetail、organizationDetail、entitlement 相關函數要在 Features 頁開啟 Customer service management(以及 Products and entitlements)。

自我檢查:先在心裡回答,再點開對答案
Q1找出等 Mia 核准、她還沒按的 request?看答案
approvals = pendingApprovalBy(mia)(她自己查用 myPendingApproval())。pendingBy(mia) 可能包含她已經按過、但 step 還在等別人的 request。
Q2breached() 與 everBreached() 差在哪?看答案
breached() 看最近一個 cycle;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 functionsReturns work items that whose most recent SLA has missed its goal.
  • JQL functionsReturns work items that have missed one of their SLA goals.
  • JQL functionsSearch 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 functionsSearch for requests where the current user is the approver for a pending approval step and is yet to approve or decline the approval.
  • JQL functionsTo use this JQL function, enable Customer service management on the Features page.
Filter 與 AI

存成 filter、分享、用 AI 寫

  1. 寫 JQL搜尋 → 切到 JQL;或用自然語言描述讓 Atlassian Intelligence 產生 JQL,再檢查結果。
  2. 存成 filterSave filter → 命名。
  3. 分享Filter details → 分享給 group、project、project role 或站上所有人(需 Share dashboards and filters 全域權限)。被分享的人仍只看得到自己有權限的 work item。
  4. 用在其他地方Dashboard gadget、filter subscription、automation 的 JQL 條件、queue 的進階篩選。
資料來源(4)・1 點無官方原文有疑慮時點開看官方原文
  • 找不到官方原文:Filter 用在 automation 與 queueFilter 文件只寫到 dashboard gadget 與 subscription;其他用途屬整理。
  • Use Rovo to search for work itemsRovo 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 filterJira's powerful work item search functionality is enhanced by the ability to save searches, called filters, for later use.
  • Manage filtersYou 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.
易錯觀念

考題愛用的錯誤說法

breached() 會找出所有曾經違約的 request。
breached() 只看最近一個 cycle;曾經違約用 everBreached()。
approver(user) 或 pendingBy(user) 只找他還沒核准的。
approver() 不論是否已決定;pendingBy() 只保證 step 還在進行、他可能已按;他還沒按要用 pendingApprovalBy()。
paused() 會找出因為下班而沒計時的 request。
paused() 是條件造成的暫停;calendar 用 withinCalendarHours()。
分享 filter 後,對方就能看到所有結果。
對方只看得到自己有 Browse 權限的 work item。
資料來源(4)・1 點無官方原文有疑慮時點開看官方原文
  • 找不到官方原文:被分享者只看得到自己有 Browse 權限的 work item官方 filter 文件沒有直接寫明;依 Browse 權限的運作推論。
  • Write JQL queries for SLAsThis filters out work items where the last SLA cycle has failed to meet its target goal.
  • JQL functionsReturns work items that have missed one of their SLA goals.
  • JQL functionsSearch 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 functionsTo find work items that are paused because they are outside calendar hours, use withinCalendarHours().
動手做

實作 Lab:用 JSM 函數找出 Acme 與待核准的單

約 25 分鐘能搜尋 HELP 的 agent 或 admin;分享 filter 要有 Share dashboards and filters 全域權限;用 AI 寫 JQL 要站台已啟用 Atlassian Intelligence(Rovo)

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

目標:在 HELP 上實際跑 organization、approval、SLA 三類 JSM 專屬 JQL 函數,比較相似函數的差別,存成 filter 分享,再請 AI 幫忙寫一條。

這個 Lab 對應的考點

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。

步驟

  1. 你應該看到:只列出 Cara 的 request,沒有 Dan 的:Dan 不屬於 Acme Corp。
  2. 你應該看到:第一條是還在等核准的那張;第二條是 Ana 已核准的那張。
  3. 你應該看到:approver(Ana) 兩張都列出(含已完成的 approval step);pendingApprovalBy(Ana) 只列出還在等她按的那張。
  4. 你應該看到:Ana 看到等她核准、她還沒按的那張;換 Leo 跑同一句,結果是空的。
  5. 你應該看到:Waiting for customer 的那張通常出現在 paused()(被 SLA 的 pause 條件停住),其他未解決的在 running();實際依 HELP 的 SLA 設定。
  6. 你應該看到:測試站台多半還沒有違約的單,結果是空的也正常。記住差別:breached() 看最近一個 cycle,everBreached() 只要曾經違約就算。
  7. 你應該看到:Kim 看得到 filter;結果只包含 Kim 有 Browse 權限的 work item。
  8. 你應該看到:AI 產生一條 JQL;檢查它有沒有用 organizationMembers() 與 resolution = Unresolved,結果和你手寫的是否一致。AI 產生的要自己驗證。

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

T1把 Kim 從 HELP 的 Service Desk Team role 暫時移除,Kim 再打開分享給她的 filter。看結果
通常 Kim 仍看得到 filter 本身,但結果是空的或沒有權限:分享 filter 不會順便給看 work item 的權限。做完加回。
T2跑 organization in organizationDetail("Region", "APAC") 這類 customerDetail/organizationDetail 查詢。看結果
如果 Space settings → Features 沒開 Customer service management,這類函數不能用;entitlement 相關函數還要開 Products and entitlements。2025 年 10 月後的新站台在 JSM 裡多半沒有這些功能,這題只看步驟想畫面。
T3把步驟 5 的 paused() 換成 withinCalendarHours(),在下班時間跑一次。看結果
withinCalendarHours() 看的是 SLA calendar,不是 pause 條件;兩者回答的是不同問題。
心像錨點:閉上眼睛想一次這個畫面

JQL 搜尋框:approvals = pendingApprovalBy(Ana) 只剩一張,approver(Ana) 有兩張。破、曾破、停、跑、完;ApprovalBy 才是還沒按。

收尾

  • 刪除或保留「Lab Acme 的 request」filter(420.7.2 可沿用)。
  • 把那張 request 從 Waiting for customer 轉回原狀態。
資料來源(4)有疑慮時點開看官方原文
一分鐘腦內整理

讀完了?用這張收攏整節

破、曾破、停、跑、完breached、everBreached、paused、running、completed。
ApprovalBy 才是還沒按pendingBy 只看 step 還在等;approver 不管按沒按。
JSM 常用 JQL 函數
  • breached=最近一次;everBreached=曾經。
  • pendingApprovalBy=還沒按;pendingBy=step 還在進行(可能已按);approver=不論是否已決定。
存成 filter、分享、用 AI 寫
  • 分享 filter ≠ 給看 work item 的權限。
本節練習

做題

題目載入中…

官方來源(本節依據)

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