Generate a GitHub Issue draft from a ticket¶
Generate a reviewable title and body from structured ticket facts. This operation does not submit an external Issue.
POST https://api.moi.matrixorigin.cn/v5/admin/feedback-tickets/{id}/github-issue-draft
Before you call this API¶
Prepare a Genesis administrator Bearer token valid in this environment. Regular personal access tokens, X-API-Key, and Workspace Owner privileges do not substitute for it. Writes in session mode also require CSRF protection. See AI Studio. Replace the example ID with a real ticket ID you are authorized to view.
Drafts are generated from the title, problem, expected and actual results, reproduction steps, suggested priority, and feedback number. They do not copy complete messages, administrator replies, or user directory information. The body depends on the current localized template; the example shows the result for one input. Detection and replacement do not guarantee removal of all sensitive content. Review manually before submitting.
Request parameters¶
curl -X POST "https://api.moi.matrixorigin.cn/v5/admin/feedback-tickets/ticket-example/github-issue-draft" \
-H "Authorization: Bearer $GENESIS_ADMIN_TOKEN" \
-H "Content-Type: application/json" \
--data '{"kind":"bug"}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes for Bearer example |
Bearer followed by a trusted administrator token for this environment. Do not also set an API Key. |
|
string |
Yes |
Ticket ID in the path. |
|
string |
Yes |
bug, feature, or auto. Omitted/empty does not automatically select auto. |
Successful response¶
{
"code": 0,
"data": {
"kind": "bug",
"template": "moi-bug",
"title": "[MOI BUG] 示例反馈",
"body": "本 Issue 基于管理员提交的 MatrixFlow Feedback Ticket 事实创建。\n\n## 问题描述\n\n界面显示结果与预期不同。\n\n## 期望行为\n\n待确认\n\n## 实际行为\n\n待确认\n\n## 复现步骤\n\n待确认\n\n## 用户建议优先级(仅供分诊参考)\n\n待确认\n\n## 内部反馈编号\n\nFB-EXAMPLE\n\n<!-- matrixflow-feedback-ticket:ticket-example -->",
"sensitive_findings": []
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
Numeric 0 on success. |
|
object |
Generated draft. |
|
string |
bug, feature, or auto. Creation policy, distinct from the final GitHub Type. |
|
string |
Current template identifier: moi-bug, moi-feature, or moi-auto. |
|
string |
Generated draft title, including the prefix for the current type. |
|
string |
Generated Markdown draft body for manual review; excludes the complete ticket conversation. |
|
string (array of strings) |
Detected categories. Currently known values are token, credential, temporary_url, personal_data, and business_data; this is not an exhaustive list of sensitive content. |
See Common objects for all public fields of nested tickets, users, messages, approval facts, and GitHub requests. Nullability and omission are listed separately. submitter_email in old SDK fixtures is not a current field.
Error response¶
{"code":"Unauthorized","msg":"Unauthorized"}
Field |
Type |
Description |
|---|---|---|
|
string / integer |
Varies by failure stage; the example uses an authentication-layer string. |
|
string |
Authentication or service failure text; service text is usually localized. |
|
string |
Text for numeric error codes during parameter parsing, distinct from msg. |
|
null |
Current service responseEnvelope errors retain null; authentication examples may omit this field. |
|
object |
Text-field 422 errors may include field/reason and other details; see errors. |
HTTP / code |
Conditions and recovery |
|---|---|
401 / Unauthorized |
Authentication rejected. Do not use a regular PAT or also send X-API-Key. |
403 / ErrForbidden |
Trusted administrator facts were not obtained, or the calling identity does not match them. |
404 / ErrFeedbackTicketNotFound |
Ticket not found. Current service errors return code/msg/data:null. |
503 / ErrServiceUnavailable |
Classified identity, directory, or authorization dependency unavailable, or network timeout. |
500 / ErrServer |
Internal processing or localization failure. Read again to confirm after a write error. |
400 / ErrFeedbackGitHubIssueDraftInvalid |
Invalid kind or JSON structure. |
422 / ErrFieldRequired or ErrFieldTooLong |
Final title or body empty or too long. See errors for field locations and Unicode counting. |
See Errors and recovery for the complete error families and stages.