curl --location --request POST '/open_api//work_item//query' \
--header 'X-PLUGIN-TOKEN: {{plugin_token}}' \
--header 'X-USER-KEY: {{user_key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"work_item_ids": [0],
"fields": [""],
"expand": {
"need_workflow": true,
"relation_fields_detail": true,
"need_multi_text": true,
"need_user_detail": true,
"need_sub_task_parent": true
}
}'
{
"data": [
{
"id": 301228xxxx, //工作项id
"name": "item1", //工作项名称
"work_item_type_key": "story", //工作项类型
"project_key": "60acd5610444ba031b503055", //空间id
"simple_name": "test", //空间域名
"template_id": 12345 //使用的模板id
"template_type": "control", //模板类型
"pattern": "Node", //工作流模式;Node节点流,State状态流
"sub_stage": "started", //需求状态(仅早期实例涉及,已弃用)
"work_item_status": {}, //工作项状态
"current_nodes": [ //当前进行中节点(仅节点流有值)
{
"id": "state_1", //节点id
"name": "node1", //节点名称
"owners": [ //节点负责人userKey列表
"7012514555133820947"
]
}
],
"state_times": [ //节点时间
{
"end_time": 1654156400805,
"name": "开始",
"start_time": 1654156400804,
"state_key": "started"
},
{
"end_time": 0,
"name": "节点表单",
"start_time": 1654156400805,
"state_key": "doing"
}
],
"created_by": "7009146719661228031", //创建者userKey
"updated_by": "7009146719661228031", //更新者userKey
"created_at": 1633776613033, //创建时间 毫秒时间戳
"updated_at": 1633776613033, //更新时间 毫秒时间戳
"relation_fields_detail": [ //关联字段详细信息,仅在expand中设置后返回
{
"field_key": "resolve_version",
"detail": [
{
"story_id": 3000985687, //关联工作项id
"work_item_type_key": "version", //关联工作项类型
"project_key": "658b9f05809f644bebd6613a" //关联工作项空间project key
}
]
}
],
"workflow_infos": { //节点信息,返回值参考WorkflowNode,仅在expand中设置后返回
"workflow_nodes": []
"connections": []
"state_flow_nodes": []
},
"multi_texts": [ //富文本信息,返回值参考MultiTextDetail,仅在expand中设置后返回
{
"field_key": "field_5c572c",
"field_value": {
"is_empty": false,
"notify_user_list": [],
"notify_user_type": "",
"doc_html": "",
"doc": "",
"doc_text": "哈哈哈\n"
}
}
],
"fields": [ //工作项字段,字段格式可查看字段格式对应表字段与属性解析格式
{
"field_alias": "",
"field_key": "aborted", //终止
"field_type_key": "aborted", //终止类型
"field_value": {
"is_aborted": false, //终止状态
"reason": "" //终止原因
}
},
{
"field_alias": "",
"field_key": "chat_group", //群组(新)
"field_value": "oc_d200e26a82e06062ef871397xxxx", //群组ID,推荐使用
"field_type_key": "chat_group"
},
{
"field_value": "oc_d200e26a82e06062ef871397xxxx", //历史逻辑中可能为数字字符串,建议优先使用chat_group字段
"field_type_key": "group_id", //群组(旧)
"field_alias": "",
"field_key": "group_id"
},
{
"field_alias": "",
"field_key": "role_owners", //角色与人员
"field_type_key": "role_owners",
"field_value": [
{
"owners": [
"7012514555184152596"
],
"role": "uiouiouio"
},
{
"owners": null,
"role": "test"
},
{
"owners": null,
"role": "tt"
}
]
}
],
}
],
"err": {},
"err_msg": "",
"err_code": 0
}