jira-browser-fetch

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Jira Browser Fetch

Jira Browser Fetch

Use this skill when Jira API-token authentication fails or the organization uses Microsoft/SSO and the user wants Jira issues, Jira Software board backlogs, or JQL result sets archived into a local raw/wiki folder.
The bundled script opens/reuses Chrome with a dedicated profile, lets the user complete SSO once, extracts Jira cookies via Chrome DevTools, verifies they represent an authenticated Jira REST session, and fetches Jira REST/HTML/XML/attachments into a raw directory.
当Jira API令牌认证失败,或组织采用Microsoft/SSO认证,而用户希望将Jira问题、Jira Software看板待办事项或JQL查询结果集归档至本地原始/wiki文件夹时,可使用本Skill。
附带的脚本会打开/复用带有专用配置文件的Chrome浏览器,让用户完成一次SSO认证,通过Chrome DevTools提取Jira Cookie,验证其代表已认证的Jira REST会话,然后将Jira REST数据、HTML/XML内容及附件抓取至原始目录。

Safety

安全注意事项

  • Never ask the user to paste Jira cookies or API tokens into chat.
  • Prefer the browser automation flow because secrets remain in the local Chrome profile.
  • Treat fetched issue data and attachments as potentially confidential.
  • Do not update/transition/edit Jira issues with this skill; it is read-only.
  • 切勿要求用户在聊天窗口中粘贴Jira Cookie或API令牌。
  • 优先使用浏览器自动化流程,因为敏感信息会保留在本地Chrome配置文件中。
  • 将抓取的问题数据和附件视为潜在机密信息。
  • 本Skill为只读工具,请勿用其更新/流转/编辑Jira问题。

Script

脚本

bash
scripts/jira-browser-fetch.js ISSUE-KEY [options]
Important options:
bash
--server URL       Jira base URL, e.g. https://example.atlassian.net
--raw-dir DIR      folder where ISSUE-KEY/ directories are created
--connected        fetch connected/referenced tickets too
--depth N          recursion depth for connected tickets
--scan-text        find issue keys in JSON/XML/HTML text, not only formal Jira links
--jql JQL          search Jira with JQL and fetch all matching issues
--backlog URL|ID   fetch all issues from a Jira Software board backlog URL or board id
--assignee-me      fetch all issues assigned to current Jira user
--max-attachment-size S  skip attachment files larger than S (default 5mb; use unlimited to disable)
--prefix A,B,C     only follow keys with these project prefixes
--wait SEC         SSO/session wait timeout per issue
--skip-existing    skip issues that already have a valid raw/<KEY>/issue.json
bash
scripts/jira-browser-fetch.js ISSUE-KEY [options]
重要选项:
bash
--server URL       Jira基础URL,例如 https://example.atlassian.net
--raw-dir DIR      创建ISSUE-KEY/目录的目标文件夹
--connected        同时抓取关联/引用的工单
--depth N          关联工单的递归深度
--scan-text        在JSON/XML/HTML文本中查找问题密钥,而非仅查找正式Jira链接
--jql JQL          使用JQL搜索Jira并抓取所有匹配的问题
--backlog URL|ID   从Jira Software看板待办事项URL或看板ID抓取所有问题
--assignee-me      抓取当前Jira用户负责的所有问题
--max-attachment-size S  跳过大小超过S的附件文件(默认5mb;使用unlimited可禁用限制)
--prefix A,B,C     仅跟踪带有这些项目前缀的密钥
--wait SEC         每个问题的SSO/会话等待超时时间
--skip-existing    跳过已存在有效raw/<KEY>/issue.json文件的问题

Example User Requests

用户请求示例

Use this skill for user requests like:
  • "Fetch Jira issue
    PROJ-123
    into
    raw/
    through my browser session."
  • "Archive this Jira backlog for my LLM wiki:
    https://example.atlassian.net/jira/software/c/projects/ABC/boards/42/backlog?epics=visible
    ."
  • "Fetch all Jira issues matching this JQL into the wiki raw folder."
  • "Pull my assigned Jira issues without asking me for an API token."
  • "Fetch this ticket and all linked tickets, including attachments under the default size limit."
本Skill适用于以下用户请求场景:
  • "通过我的浏览器会话将Jira问题
    PROJ-123
    抓取至
    raw/
    文件夹。"
  • "将这个Jira待办事项归档到我的LLM wiki:
    https://example.atlassian.net/jira/software/c/projects/ABC/boards/42/backlog?epics=visible
    。"
  • "将匹配此JQL的所有Jira问题抓取至wiki原始文件夹。"
  • "无需询问API令牌,抓取我负责的Jira问题。"
  • "抓取此工单及所有关联工单,包括默认大小限制内的附件。"

Shared Atlassian SSO Session

共享Atlassian SSO会话

All five Atlassian skills (
jira-browser-fetch
,
jira-update
,
confluence-browser-fetch
,
confluence-update
,
bitbucket-browser-fetch
) default to the same Chrome profile (
~/.local/share/atlassian-browser-chrome
) and DevTools port (
9223
). Log in once via any skill and the others reuse that session automatically — no env vars needed.
This is a separate Chrome window from any browser the user already has open. The script always launches its own profile with remote-debugging enabled; cookies from the user's regular Chrome are not read. The user logs in inside the window the script opens; that session is then reused by every Atlassian skill until it expires.
Reuse signal. When attaching to an existing session, the script prints
Reusing Chrome DevTools on port 9223
and (if the target tab is open)
Found existing tab for <host>
. When you see those lines, do not ask the user to re-SSO — the session is already valid.
If Chrome/Chromium is installed via Flatpak, Snap, or another non-PATH location, set
CHROME=/path/to/launcher
(or a wrapper script) so the script can find the binary.
Override with
ATLASSIAN_CHROME_PROFILE
and/or
ATLASSIAN_CHROME_DEBUG_PORT
to relocate the shared profile/port, or use skill-specific
*_CHROME_PROFILE
/
*_CHROME_DEBUG_PORT
env vars for isolation.
所有五个Atlassian Skill(
jira-browser-fetch
jira-update
confluence-browser-fetch
confluence-update
bitbucket-browser-fetch
)默认使用同一个Chrome配置文件(
~/.local/share/atlassian-browser-chrome
)和DevTools端口(
9223
)。通过任意一个Skill登录一次后,其他Skill会自动复用该会话——无需设置环境变量。
这是一个独立于用户已打开的浏览器的Chrome窗口。 脚本始终启动带有远程调试功能的专用配置文件;不会读取用户常规Chrome浏览器中的Cookie。用户在脚本打开的窗口中完成登录,该会话会被所有Atlassian Skill复用直至过期。
复用信号:当附加到现有会话时,脚本会打印
Reusing Chrome DevTools on port 9223
,如果目标标签页已打开,还会打印
Found existing tab for <host>
。看到这些信息时,请勿要求用户重新进行SSO认证——会话已有效。
如果Chrome/Chromium通过Flatpak、Snap或其他非PATH路径安装,请设置
CHROME=/path/to/launcher
(或包装脚本)以便脚本找到二进制文件。
可通过
ATLASSIAN_CHROME_PROFILE
和/或
ATLASSIAN_CHROME_DEBUG_PORT
覆盖默认设置,重新定位共享配置文件/端口;也可使用Skill专属的
*_CHROME_PROFILE
/
*_CHROME_DEBUG_PORT
环境变量实现隔离。

Typical Workflow

典型工作流程

  1. Identify raw directory.
  2. Run the script and show the command first.
  3. If Chrome opens (first run or expired session), ask the user to complete SSO in that window. On subsequent invocations the script reuses the session silently — see the Reuse signal above.
  4. Verify saved files.
Example:
bash
scripts/jira-browser-fetch.js \
  SWING-4770 \
  --server https://example.atlassian.net \
  --raw-dir ./raw \
  --connected \
  --scan-text \
  --prefix SWING,SSD,EC \
  --depth 1
  1. 确定原始目录。
  2. 先运行脚本并展示命令。
  3. 如果Chrome浏览器打开(首次运行或会话过期),请用户在该窗口中完成SSO认证。后续调用时脚本会静默复用会话——参见上方的复用信号。
  4. 验证已保存的文件。
示例:
bash
scripts/jira-browser-fetch.js \
  SWING-4770 \
  --server https://example.atlassian.net \
  --raw-dir ./raw \
  --connected \
  --scan-text \
  --prefix SWING,SSD,EC \
  --depth 1

Fetch requested issues plus everything assigned to current user:

Fetch requested issues plus everything assigned to current user:

scripts/jira-browser-fetch.js
SWING-4611 SWING-4621
--server https://example.atlassian.net
--raw-dir ./raw
--assignee-me
scripts/jira-browser-fetch.js
SWING-4611 SWING-4621
--server https://example.atlassian.net
--raw-dir ./raw
--assignee-me

Fetch every issue currently visible in a Jira Software board backlog:

Fetch every issue currently visible in a Jira Software board backlog:

Output Layout

输出结构

For each issue:
text
raw/ISSUE-KEY/
├── issue.json           # Jira REST issue with renderedFields,names,schema,changelog
├── issue.html           # Browser issue page HTML
├── issue.xml            # Jira XML issue view
├── remotelinks.json     # Jira remote links endpoint
├── connected-keys.json  # Connected/referenced issue keys detected
├── metadata.json        # Fetch metadata
├── attachments.json     # Attachment manifest, including skipped large-file references
└── attachments/         # Downloaded attachments under max-size threshold
A run manifest is written to:
text
raw/jira-browser-fetch-run.json
Backlog fetches also write:
text
raw/jira-board-<board-id>-backlog.json
每个问题的输出结构如下:
text
raw/ISSUE-KEY/
├── issue.json           # Jira REST issue with renderedFields,names,schema,changelog
├── issue.html           # Browser issue page HTML
├── issue.xml            # Jira XML issue view
├── remotelinks.json     # Jira remote links endpoint
├── connected-keys.json  # Connected/referenced issue keys detected
├── metadata.json        # Fetch metadata
├── attachments.json     # Attachment manifest, including skipped large-file references
└── attachments/         # Downloaded attachments under max-size threshold
运行清单会写入至:
text
raw/jira-browser-fetch-run.json
待办事项抓取还会写入:
text
raw/jira-board-<board-id>-backlog.json

Installation / PATH

安装 / 路径配置

The skill can be used directly by path. Optionally install a convenience symlink:
bash
mkdir -p ~/.local/bin
ln -sf ~/.pi/agent/skills/jira-browser-fetch/scripts/jira-browser-fetch.js ~/.local/bin/jira-browser-fetch
Then use:
bash
jira-browser-fetch SWING-4770 --raw-dir ./raw --connected
可直接通过路径使用本Skill。也可选择安装便捷符号链接:
bash
mkdir -p ~/.local/bin
ln -sf ~/.pi/agent/skills/jira-browser-fetch/scripts/jira-browser-fetch.js ~/.local/bin/jira-browser-fetch
之后即可使用:
bash
jira-browser-fetch SWING-4770 --raw-dir ./raw --connected

References

参考资料

  • Usage reference
  • Distribution guide
  • 使用参考
  • 分发指南