AgentSkillsCN

jira-intel

在与Intel Jira(jira.devtools.intel.com)交互时使用,可用于查看问题、搜索缺陷、创建工单、更新状态,或查询项目信息。

SKILL.md
--- frontmatter
name: jira-intel
description: Use when interacting with Intel Jira (jira.devtools.intel.com) to check issues, search bugs, create tickets, update status, or query project information

Intel Jira Integration

Overview

This skill provides authenticated access to Intel's Jira instance at jira.devtools.intel.com using credentials from ~/.netrc. Handles common Jira operations via REST API with curl.

When to Use

Use this skill when you need to:

  • Check status of specific Jira issues
  • Search for bugs or tasks (by assignee, status, project)
  • Create new bug reports or feature tickets
  • Update issue status or fields
  • Query project information
  • Add comments to issues

When NOT to use:

  • For other Jira instances (use generic Jira skills)
  • When jira-cli tool is available and preferred

Authentication

Credentials stored in ~/.netrc:

code
machine jira.devtools.intel.com
  login $(login)
  password $(password)

Extract credentials dynamically:

bash
# Extract login and password from .netrc
JIRA_LOGIN=$(grep -A2 "machine jira.devtools.intel.com" ~/.netrc | grep login | awk '{print $2}')
JIRA_PASSWORD=$(grep -A2 "machine jira.devtools.intel.com" ~/.netrc | grep password | awk '{print $2}')

# Use with curl
curl -u "$JIRA_LOGIN:$JIRA_PASSWORD" \
  -H "Content-Type: application/json" \
  https://jira.devtools.intel.com/rest/api/2/...

Alternative: curl --netrc automatically reads ~/.netrc

bash
curl --netrc \
  -H "Content-Type: application/json" \
  https://jira.devtools.intel.com/rest/api/2/...

Quick Reference

OperationAPI EndpointMethod
Get issue/rest/api/2/issue/{key}GET
Search issues/rest/api/2/search?jql={query}GET
Create issue/rest/api/2/issuePOST
Update issue/rest/api/2/issue/{key}PUT
Add comment/rest/api/2/issue/{key}/commentPOST
Get project/rest/api/2/project/{key}GET

Common Operations

Check Issue Status

bash
curl --netrc \
  https://jira.devtools.intel.com/rest/api/2/issue/GAUDISW-12345 \
  | jq '.fields.status.name'

Search for Open Bugs Assigned to Me

bash
curl --netrc \
  "https://jira.devtools.intel.com/rest/api/2/search?jql=assignee=currentUser()+AND+type=Bug+AND+status=Open" \
  | jq '.issues[] | {key, summary: .fields.summary, status: .fields.status.name}'

Common JQL patterns:

  • My open issues: assignee=currentUser()+AND+status=Open
  • Project bugs: project=PROJ+AND+type=Bug
  • Recent updates: updated>=-7d+ORDER+BY+updated+DESC

Create Bug Ticket

Intel Jira requires these custom fields:

  • customfield_20821: "Is this a Regression?" (Yes/No)
  • customfield_24301: "Targeted Version/s" (e.g., "Unknown")
bash
curl --netrc \
  -X POST \
  -H "Content-Type: application/json" \
  https://jira.devtools.intel.com/rest/api/2/issue \
  -d '{
    "fields": {
      "project": {"key": "GAUDISW"},
      "summary": "Test failure in authentication service",
      "description": "The test_authentication_service test fails with timeout error after 30s",
      "issuetype": {"name": "Bug"},
      "components": [{"name": "CI-CD Support"}],
      "priority": {"name": "Undecided"},
      "customfield_20821": {"value": "No"},
      "customfield_24301": [{"value": "Unknown"}]
    }
  }'

Response includes:

  • key: Issue identifier (e.g., GAUDISW-246227)
  • self: Full URL to the issue

Add Comment to Issue

bash
curl --netrc \
  -X POST \
  -H "Content-Type: application/json" \
  https://jira.devtools.intel.com/rest/api/2/issue/GAUDISW-12345/comment \
  -d '{
    "body": "Investigation shows this is caused by network timeout. Increasing timeout to 60s."
  }'

Intel Jira Specifics

Required Custom Fields

When creating issues, these fields are mandatory:

  • Is this a Regression? (customfield_20821): Values: "Yes" / "No"
  • Targeted Version/s (customfield_24301): Array of strings (use "Unknown" if uncertain)

Common Projects

  • GAUDISW: Gaudi SW project
  • Add others as discovered

Components

Common components in GAUDISW:

  • DevOps_K8S: Kubernetes infrastructure
  • CI-CD Support: CI/CD pipeline issues
  • Check existing issues for project-specific components

Common Mistakes

❌ Forgetting Required Custom Fields

bash
# This will fail with "Field is required" error
{"fields": {"project": {"key": "GAUDISW"}, "summary": "Bug"}}

✅ Include Required Fields

bash
{"fields": {
  "project": {"key": "GAUDISW"},
  "summary": "Bug",
  "customfield_20821": {"value": "No"},
  "customfield_24301": [{"value": "Unknown"}]
}}

❌ Using Wrong Authentication

bash
# Don't try API tokens (Intel Jira uses Basic Auth)
curl -H "Authorization: Bearer token" ...

✅ Use Basic Auth from .netrc

bash
curl --netrc ...

❌ Unescaped JQL Queries

bash
# Spaces in URL break the request
curl "...search?jql=assignee = currentUser() AND status = Open"

✅ URL-Encode JQL

bash
curl "...search?jql=assignee=currentUser()+AND+status=Open"

Workflow Example

User asks: "Check if there are any critical bugs assigned to me and create a ticket for the test failure"

  1. Search for critical bugs:
bash
curl --netrc \
  "https://jira.devtools.intel.com/rest/api/2/search?jql=assignee=currentUser()+AND+type=Bug+AND+priority=Critical"
  1. Examine existing bug to identify project patterns:
bash
curl --netrc \
  https://jira.devtools.intel.com/rest/api/2/issue/GAUDISW-246225 \
  | jq '.fields | {project, components, customfield_20821, customfield_24301}'
  1. Create new bug with proper fields:
bash
curl --netrc \
  -X POST \
  -H "Content-Type: application/json" \
  https://jira.devtools.intel.com/rest/api/2/issue \
  -d '{...}'

Tips

  • Use jq for parsing: Pipe curl output to jq for readable JSON
  • Check existing issues first: Use them as templates for required fields
  • URL encode JQL: Replace spaces with + in search queries
  • Save common queries: Create shell aliases for frequent searches
  • Validate fields: If creation fails, check an existing issue for field structure

Real-World Impact

Before this skill:

  • 5+ minutes to figure out authentication
  • Trial-and-error to discover required custom fields
  • Failed issue creation attempts
  • Manual JSON parsing

With this skill:

  • Immediate authentication from .netrc
  • Known required fields upfront
  • One-shot issue creation
  • Clean output with jq patterns