-
JIRA 接口描述
定义:
{URL}: jra的访问地址
数据参数:json标准数据格式
http://confluence的访问地址/rest/midea/1.0/
返回:
成功:{"code":0, "result":[]}
失败:{"code":1, "errorMessages":2}
编码格式:UTF8
验证方式:Basic authentication
错误码映射表
状态:
code | message |
0 | 成功 |
1 | 操作失败 |
2 | 用户组已存在 |
|
|
4 | 用户组不存在 |
5 | 参数不能为空 |
6 | 用户不存在 |
方法: | /jira/rest/api/2/search |
类型 | GET |
参数: | ?jql=project = DEMO and issueType= |
返回值: | { "expand": "names,schema", "startAt": 0, "maxResults": 50, "total": 1, "issues": [ { "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields", "id": "10403", "self": "http://localhost:2990/jira/rest/api/2/issue/10403", "key": "DEMO-32", "fields": { "issuetype": { "self": "http://localhost:2990/jira/rest/api/2/issuetype/10005", "id": "10005", "description": "For Go2Group SYNAPSE Test Case issue type", "iconUrl": "http://localhost:2990/jira/download/resources/com.go2group.jira.plugin.synapse/synapse/images/icon-testcase.png", "name": "测试用例", "subtask": false }, "timespent": null, "project": { "self": "http://localhost:2990/jira/rest/api/2/project/10001", "id": "10001", "key": "DEMO", "name": "demo", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/projectavatar?avatarId=10324", "24x24": "http://localhost:2990/jira/secure/projectavatar?size=small&avatarId=10324", "16x16": "http://localhost:2990/jira/secure/projectavatar?size=xsmall&avatarId=10324", "32x32": "http://localhost:2990/jira/secure/projectavatar?size=medium&avatarId=10324" } }, "fixVersions": [], "aggregatetimespent": null, "resolution": null, "customfield_10104": null, "customfield_10105": null, "customfield_10106": null, "customfield_10107": null, "customfield_10108": null, "resolutiondate": null, "workratio": -1, "lastViewed": "2022-02-17T11:17:03.575+0800", "watches": { "self": "http://localhost:2990/jira/rest/api/2/issue/DEMO-32/watchers", "watchCount": 0, "isWatching": false }, "created": "2022-01-26T09:10:44.000+0800", "customfield_10021": "1", "priority": { "self": "http://localhost:2990/jira/rest/api/2/priority/3", "iconUrl": "http://localhost:2990/jira/images/icons/priorities/medium.svg", "name": "Medium", "id": "3" }, "customfield_10100": null, "customfield_10101": null, "customfield_10102": null, "labels": [], "customfield_10103": null, "customfield_10016": null, "customfield_10017": null, "customfield_10018": null, "customfield_10019": null, "timeestimate": null, "aggregatetimeoriginalestimate": null, "versions": [], "issuelinks": [], "assignee": null, "updated": "2022-01-26T13:58:48.000+0800", "status": { "self": "http://localhost:2990/jira/rest/api/2/status/10000", "description": "", "iconUrl": "http://localhost:2990/jira/images/icons/status_generic.gif", "name": "待办", "id": "10000", "statusCategory": { "self": "http://localhost:2990/jira/rest/api/2/statuscategory/2", "id": 2, "key": "new", "colorName": "blue-gray", "name": "待办" } }, "components": [], "timeoriginalestimate": null, "description": null, "customfield_10010": "\t\t\t<a href=\"/jira/browse/DEMO-31\">DEMO-31</a>", "customfield_10013": "", "customfield_10014": { "self": "http://localhost:2990/jira/rest/api/2/customFieldOption/10700", "value": "通过", "id": "10700" }, "customfield_10005": "0|i0001j:", "customfield_10007": "{summaryBean=com.atlassian.jira.plugin.devstatus.rest.SummaryBean@3294f876[summary={pullrequest=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@1655bca0[overall=PullRequestOverallBean{stateCount=0, state='OPEN', details=PullRequestOverallDetails{openCount=0, mergedCount=0, declinedCount=0}},byInstanceType={}], build=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@74ca2f4f[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BuildOverallBean@4fc13dca[failedBuildCount=0,successfulBuildCount=0,unknownBuildCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], review=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@45210237[overall=com.atlassian.jira.plugin.devstatus.summary.beans.ReviewsOverallBean@65eb4c7f[stateCount=0,state=<null>,dueDate=<null>,overDue=false,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], deployment-environment=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@40feb7da[overall=com.atlassian.jira.plugin.devstatus.summary.beans.DeploymentOverallBean@697fd62[topEnvironments=[],showProjects=false,successfulCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], repository=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@4b6a773d[overall=com.atlassian.jira.plugin.devstatus.summary.beans.CommitOverallBean@745d529b[count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], branch=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@41a87bad[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BranchOverallBean@786df217[count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}]},errors=[],configErrors=[]], devSummaryJson={\"cachedValue\":{\"errors\":[],\"configErrors\":[],\"summary\":{\"pullrequest\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"stateCount\":0,\"state\":\"OPEN\",\"details\":{\"openCount\":0,\"mergedCount\":0,\"declinedCount\":0,\"total\":0},\"open\":true},\"byInstanceType\":{}},\"build\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"failedBuildCount\":0,\"successfulBuildCount\":0,\"unknownBuildCount\":0},\"byInstanceType\":{}},\"review\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"stateCount\":0,\"state\":null,\"dueDate\":null,\"overDue\":false,\"completed\":false},\"byInstanceType\":{}},\"deployment-environment\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"topEnvironments\":[],\"showProjects\":false,\"successfulCount\":0},\"byInstanceType\":{}},\"repository\":{\"overall\":{\"count\":0,\"lastUpdated\":null},\"byInstanceType\":{}},\"branch\":{\"overall\":{\"count\":0,\"lastUpdated\":null},\"byInstanceType\":{}}}},\"isStale\":false}}", "customfield_10008": "集合1", "customfield_10009": "", "aggregatetimeestimate": null, "summary": "需求2-测试用例1", "creator": { "self": "http://localhost:2990/jira/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "2342407551@qq.com", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10338", "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10338", "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10338", "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10338" }, "displayName": "admin全名", "active": true, "timeZone": "Asia/Shanghai" }, "subtasks": [], "reporter": { "self": "http://localhost:2990/jira/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "223@SS.com", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10338", "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10338", "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10338", "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10338" }, "displayName": "admin全名", "active": true, "timeZone": "Asia/Shanghai" }, "customfield_10000": null, "aggregateprogress": { "progress": 0, "total": 0 }, "customfield_10001": null, "environment": null, "duedate": null, "progress": { "progress": 0, "total": 0 }, "votes": { "self": "http://localhost:2990/jira/rest/api/2/issue/DEMO-32/votes", "votes": 0, "hasVoted": false } } } ] } |
注释: 根据JQL条件进行查询 |
方法: | /rest/api/2/issue/{issueIdOrKey} |
类型 | GET |
参数: | {issueIdOrKey} |
返回值: | { "expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations", "id": "10405", "self": "http://localhost:2990/jira/rest/api/2/issue/10405", "key": "DEMO-34", "fields": { "issuetype": { "self": "http://localhost:2990/jira/rest/api/2/issuetype/10005", "id": "10005", "description": "For Go2Group SYNAPSE Test Case issue type", "iconUrl": "http://localhost:2990/jira/download/resources/com.go2group.jira.plugin.synapse/synapse/images/icon-testcase.png", "name": "测试用例", "subtask": false }, "timespent": null, "project": { "self": "http://localhost:2990/jira/rest/api/2/project/10001", "id": "10001", "key": "DEMO", "name": "demo", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/projectavatar?avatarId=10324", "24x24": "http://localhost:2990/jira/secure/projectavatar?size=small&avatarId=10324", "16x16": "http://localhost:2990/jira/secure/projectavatar?size=xsmall&avatarId=10324", "32x32": "http://localhost:2990/jira/secure/projectavatar?size=medium&avatarId=10324" } }, "fixVersions": [], "aggregatetimespent": null, "resolution": null, "customfield_10104": null, "customfield_10105": null, "customfield_10106": null, "customfield_10107": null, "customfield_10108": null, "resolutiondate": null, "workratio": -1, "lastViewed": "2022-02-17T10:43:00.303+0800", "watches": { "self": "http://localhost:2990/jira/rest/api/2/issue/DEMO-34/watchers", "watchCount": 0, "isWatching": false }, "created": "2022-01-26T09:43:13.000+0800", "customfield_10021": "0", "priority": { "self": "http://localhost:2990/jira/rest/api/2/priority/3", "iconUrl": "http://localhost:2990/jira/images/icons/priorities/medium.svg", "name": "Medium", "id": "3" }, "customfield_10100": null, "customfield_10101": null, "customfield_10102": null, "labels": [], "customfield_10103": null, "customfield_10016": null, "customfield_10017": null, "customfield_10018": null, "customfield_10019": null, "timeestimate": null, "aggregatetimeoriginalestimate": null, "versions": [], "issuelinks": [], "assignee": null, "updated": "2022-01-26T09:43:13.000+0800", "status": { "self": "http://localhost:2990/jira/rest/api/2/status/10000", "description": "", "iconUrl": "http://localhost:2990/jira/images/icons/status_generic.gif", "name": "待办", "id": "10000", "statusCategory": { "self": "http://localhost:2990/jira/rest/api/2/statuscategory/2", "id": 2, "key": "new", "colorName": "blue-gray", "name": "待办" } }, "components": [], "timeoriginalestimate": null, "description": null, "customfield_10010": "\t\t\t DEMO-31 ", "customfield_10013": "", "customfield_10014": { "self": "http://localhost:2990/jira/rest/api/2/customFieldOption/10703", "value": "未执行", "id": "10703" }, "timetracking": {}, "customfield_10005": "0|i0001z:", "customfield_10007": "{summaryBean=com.atlassian.jira.plugin.devstatus.rest.SummaryBean@66d05fca[summary={pullrequest=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@9154402[overall=PullRequestOverallBean{stateCount=0, state='OPEN', details=PullRequestOverallDetails{openCount=0, mergedCount=0, declinedCount=0}},byInstanceType={}], build=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@28342dfd[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BuildOverallBean@ba259ad[failedBuildCount=0,successfulBuildCount=0,unknownBuildCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], review=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6e22971c[overall=com.atlassian.jira.plugin.devstatus.summary.beans.ReviewsOverallBean@52cde4c2[stateCount=0,state=<null>,dueDate=<null>,overDue=false,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], deployment-environment=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@5b9f70a3[overall=com.atlassian.jira.plugin.devstatus.summary.beans.DeploymentOverallBean@42e9254c[topEnvironments=[],showProjects=false,successfulCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], repository=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@3809c07a[overall=com.atlassian.jira.plugin.devstatus.summary.beans.CommitOverallBean@5dfd84d[count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], branch=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@2565aa3d[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BranchOverallBean@2ead3898[count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}]},errors=[],configErrors=[]], devSummaryJson={\"cachedValue\":{\"errors\":[],\"configErrors\":[],\"summary\":{\"pullrequest\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"stateCount\":0,\"state\":\"OPEN\",\"details\":{\"openCount\":0,\"mergedCount\":0,\"declinedCount\":0,\"total\":0},\"open\":true},\"byInstanceType\":{}},\"build\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"failedBuildCount\":0,\"successfulBuildCount\":0,\"unknownBuildCount\":0},\"byInstanceType\":{}},\"review\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"stateCount\":0,\"state\":null,\"dueDate\":null,\"overDue\":false,\"completed\":false},\"byInstanceType\":{}},\"deployment-environment\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"topEnvironments\":[],\"showProjects\":false,\"successfulCount\":0},\"byInstanceType\":{}},\"repository\":{\"overall\":{\"count\":0,\"lastUpdated\":null},\"byInstanceType\":{}},\"branch\":{\"overall\":{\"count\":0,\"lastUpdated\":null},\"byInstanceType\":{}}}},\"isStale\":false}}", "customfield_10008": "集合1", "attachment": [], "customfield_10009": "", "aggregatetimeestimate": null, "summary": "需求2-测试用例3", "creator": { "self": "http://localhost:2990/jira/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "23234@SS.com", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10338", "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10338", "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10338", "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10338" }, "displayName": "admin全名", "active": true, "timeZone": "Asia/Shanghai" }, "subtasks": [], "reporter": { "self": "http://localhost:2990/jira/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "23234@SS.com", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10338", "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10338", "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10338", "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10338" }, "displayName": "admin全名", "active": true, "timeZone": "Asia/Shanghai" }, "customfield_10000": null, "aggregateprogress": { "progress": 0, "total": 0 }, "customfield_10001": null, "environment": null, "duedate": null, "progress": { "progress": 0, "total": 0 }, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 }, "votes": { "self": "http://localhost:2990/jira/rest/api/2/issue/DEMO-34/votes", "votes": 0, "hasVoted": false }, "worklog": { "startAt": 0, "maxResults": 20, "total": 0, "worklogs": [] } } } { "errorMessages": [ "问题不存在" ], "errors": {} } |
注释: 1、问题由其 ID 或键标识,来进行查找,issueKEy不区分大小写 2、可以匿名访问此操作。 | |
创建issue
方法: | /rest/api/2/issue |
类型 | POST |
参数: | { "update": {}, "fields": { "summary": "Main order flow broken", "parent": { "key": "PROJ-123" }, "issuetype": { "id": "10000" }, "components": [ { "id": "10000" } ], "customfield_20000": "06/Jul/19 3:25 PM", "customfield_40000": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "text": "Occurs on all orders", "type": "text" } ] } ] }, "customfield_70000": [ "jira-administrators", "jira-software-users" ], "project": { "id": "10000" }, "description": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "text": "Order entry fails when selecting supplier.", "type": "text" } ] } ] }, "reporter": { "id": "5b10a2844c20165700ede21g" }, "fixVersions": [ { "id": "10001" } ], "customfield_10000": "09/Jun/19", "priority": { "id": "20000" }, "labels": [ "bugfix", "blitz_test" ], "timetracking": { "remainingEstimate": "5", "originalEstimate": "10" }, "customfield_30000": [ "10000", "10002" ], "customfield_80000": { "value": "red" }, "security": { "id": "10000" }, "environment": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "text": "UAT", "type": "text" } ] } ] }, "versions": [ { "id": "10000" } ], "duedate": "2019-05-11", "customfield_60000": "jira-software-users", "customfield_50000": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "text": "Could impact day-to-day work.", "type": "text" } ] } ] }, "assignee": { "id": "5b109f2e9729b51b54dc274d" } } } |
返回值: | { "id": "10000", "key": "ED-24", "self": "https://your-domain.atlassian.net/rest/api/3/issue/10000", "transition": { "status": 200, "errorCollection": { "errorMessages": [], "errors": {} } } } |
注释:创建issue的传参,需要根据实际issue的问题类型和相关字段进行传参,文档只是举列写明一下传参结构,创建不同的issue问题,具体传参也不一致 |
编辑issue
方法: | /rest/api/2/issue/{issueIdOrKey} |
类型 | PUT |
参数: | { "historyMetadata": { "actor": { "avatarUrl": "http://mysystem/avatar/tony.jpg", "displayName": "Tony", "id": "tony", "type": "mysystem-user", "url": "http://mysystem/users/tony" }, "extraData": { "Iteration": "10a", "Step": "4" }, "description": "From the order testing process", "generator": { "id": "mysystem-1", "type": "mysystem-application" }, "cause": { "id": "myevent", "type": "mysystem-event" }, "activityDescription": "Complete order processing", "type": "myplugin:type" }, "update": { "summary": [ { "set": "Bug in business logic" } ], "components": [ { "set": "" } ], "timetracking": [ { "edit": { "remainingEstimate": "4d", "originalEstimate": "1w 1d" } } ], "labels": [ { "add": "triaged" }, { "remove": "blocker" } ] }, "fields": { "summary": "Completed orders still displaying in pending", "customfield_10010": 1, "customfield_10000": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "text": "Investigation underway", "type": "text" } ] } ] } }, "properties": [ { "value": "Order number 10784", "key": "key1" }, { "value": "Order number 10923", "key": "key2" } ] } |
返回值: | |
注释: |
issue操作过程及状态改变
方法: | /rest/api/2/issue/{issueIdOrKey}/transitions |
类型 | POST |
参数: | { "fields": { "assignee": { "name": "bob" }, "resolution": { "name": "Fixed" } }, "transition": { "id": "5" } } |
返回值: | |
注释: 如果转换有屏幕,则更新转换屏幕中的字段。 sortByCategory 要更新转换屏幕上的字段,请在请求正文中的fields或参数中指定字段。使用Get transitions 获取有关字段的详细信息。transitions.fields |
创建备注
方法: | /rest/api/2/issue/{issueIdOrKey}/comment |
类型 | POST |
参数: | { "body":"222" } |
返回值: | { "self": "http://localhost:2990/jira/rest/api/2/issue/10600/comment/10004", "id": "10004", "author": { "self": "http://localhost:2990/jira/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "2234@SS.com", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10338", "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10338", "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10338", "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10338" }, "displayName": "admin全名", "active": true, "timeZone": "Asia/Shanghai" }, "body": "222", "updateAuthor": { "self": "http://localhost:2990/jira/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "2342407551@qq.com", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10338", "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10338", "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10338", "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10338" }, "displayName": "admin全名", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2022-02-17T15:45:10.651+0800", "updated": "2022-02-17T15:45:10.651+0800" } |
注释: |
修改备注
方法: | /rest/api/2/issue/{issueIdOrKey}/comment/{id} |
类型 | PUT |
参数: | { "body":"222" } |
返回值: | { "self": "http://localhost:2990/jira/rest/api/2/issue/10600/comment/10003", "id": "10003", "author": { "self": "http://localhost:2990/jira/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "223422@SS.com", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10338", "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10338", "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10338", "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10338" }, "displayName": "admin全名", "active": true, "timeZone": "Asia/Shanghai" }, "body": "222123123", "updateAuthor": { "self": "http://localhost:2990/jira/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "223423@SS.com", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10338", "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10338", "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10338", "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10338" }, "displayName": "admin全名", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2022-02-17T15:35:56.000+0800", "updated": "2022-02-17T15:46:15.289+0800" } |
注释: |
删除备注
方法: | /rest/api/2/issue/{issueIdOrKey}/comment/{id} |
类型 | DELETE |
参数: | |
返回值: | |
注释: |
附件上传
方法: | /rest/api/3/issue/{issueIdOrKey}/attachments |
类型 | POST |
参数: | { } |
返回值: | [ { "self": "http://localhost:2990/jira/rest/api/2/attachment/10001", "id": "10001", "filename": "Squirrel-UpdateSelf.log", "author": { "self": "http://localhost:2990/jira/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "2234@SS.com", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10338", "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10338", "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10338", "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10338" }, "displayName": "admin全名", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2022-02-17T16:58:05.000+0800", "size": 260, "mimeType": "text/plain", "content": "http://localhost:2990/jira/secure/attachment/10001/Squirrel-UpdateSelf.log" } ] |
注释: 附件发布为 multipart/form-data 请求必须有一个X-Atlassian-Token: no-check标头 包含附件的 multipart/form-data 参数的名称必须是fil |
获取项目版本列表
方法: | /rest/api/2/project/{projectIdOrKey}/version |
类型 | GET |
参数: | ?maxResults=50 |
返回值: | { "self": "http://localhost:2990/jira/rest/api/2/project/DEMO/version?maxResults=1&startAt=0", "nextPage": "http://localhost:2990/jira/rest/api/2/project/DEMO/version?maxResults=1&startAt=1", "maxResults": 1, "startAt": 0, "total": 2, "isLast": false, "values": [ { "self": "http://localhost:2990/jira/rest/api/2/version/10000", "id": "10000", "name": "版本", "archived": false, "released": true, "releaseDate": "2021-08-11", "userReleaseDate": "11/八月/21", "projectId": 10001 } ] } |
注释: maxResults 每页返回条数 |
输入项目名称,返回倒序版本号列表
方法: | /plugins/servlet/jingao/tools/jiraApi?funName=getVersionList |
类型: | GET |
参数: | projectKey=XY |
返回值: | {"code":1000,"data":[{"versionName":"11"}],"errno":0,"msg":"操作成功"} |
注释: |
输入版本号和项目key,返回版本号关联的issue号、issue名称、经办人、跳转链接。
方法 | /plugins/servlet/jingao/tools/jiraApi?funName=getIssueList |
类型: | GET |
参数: | projectKey=XY&versionName=11 |
返回值: | {"code":1000,"data":[{"summary":"123","issueKey":"XY-1","issueUrl":"http://localhost:2990/jira/jira/browse/XY-1","assignee":"jira管理员"}],"errno":0,"msg":"操作成功"} |
注释: |
方法: | /jira/rest/api/2/user?username=admin |
类型 | GET |
参数: | ?username=admin |
返回值: | { "self": "http://localhost:2990/jira/rest/api/2/user?username=liuxu1", "key": "JIRAUSER10800", "name": "liusdf1", "emailAddress": "23234@SS.com", "avatarUrls": { "48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10337", "24x24": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10337", "16x16": "http://localhost:2990/jira/secure/useravatar?size=xsmall&avatarId=10337", "32x32": "http://localhost:2990/jira/secure/useravatar?size=medium&avatarId=10337" }, "displayName": "张三1", "active": true, "deleted": false, "timeZone": "Asia/Shanghai", "locale": "zh_CN", "groups": { "size": 1, "items": [] }, "applicationRoles": { "size": 1, "items": [] }, "expand": "groups,applicationRoles" } |
注释: |
Confluence 接口描述
方法: | /rest/api/space/{spaceKey}/content |
类型 | GET |
参数: | |
返回值: | { "page": { "results": [ { "id": "327683", "type": "page", "status": "current", "title": "智慧芽开发", "extensions": { "position": "none" }, "_links": { "webui": "/pages/viewpage.action?pageId=327683", "edit": "/pages/resumedraft.action?draftId=327683", "tinyui": "/x/AwAF", "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/content/327683" }, "_expandable": { "container": "/rest/api/space/SPC", "metadata": "", "operations": "", "children": "/rest/api/content/327683/child", "restrictions": "/rest/api/content/327683/restriction/byOperation", "history": "/rest/api/content/327683/history", "ancestors": "", "body": "", "version": "", "descendants": "/rest/api/content/327683/descendant", "space": "/rest/api/space/SPC" } }, { "id": "2686983", "type": "page", "status": "current", "title": "123123", "extensions": { "position": "none" }, "_links": { "webui": "/display/SPC/123123", "edit": "/pages/resumedraft.action?draftId=2686983&draftShareId=89e6dfc2-00f4-4229-9e6a-802485131136", "tinyui": "/x/BwAp", "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/content/2686983" }, "_expandable": { "container": "/rest/api/space/SPC", "metadata": "", "operations": "", "children": "/rest/api/content/2686983/child", "restrictions": "/rest/api/content/2686983/restriction/byOperation", "history": "/rest/api/content/2686983/history", "ancestors": "", "body": "", "version": "", "descendants": "/rest/api/content/2686983/descendant", "space": "/rest/api/space/SPC" } }, { "id": "2686985", "type": "page", "status": "current", "title": "222333", "extensions": { "position": "none" }, "_links": { "webui": "/display/SPC/222333", "edit": "/pages/resumedraft.action?draftId=2686985&draftShareId=408ef359-e0b5-498d-aabb-c942e958ae5e", "tinyui": "/x/CQAp", "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/content/2686985" }, "_expandable": { "container": "/rest/api/space/SPC", "metadata": "", "operations": "", "children": "/rest/api/content/2686985/child", "restrictions": "/rest/api/content/2686985/restriction/byOperation", "history": "/rest/api/content/2686985/history", "ancestors": "", "body": "", "version": "", "descendants": "/rest/api/content/2686985/descendant", "space": "/rest/api/space/SPC" } }, { "id": "2686987", "type": "page", "status": "current", "title": "A111", "extensions": { "position": "none" }, "_links": { "webui": "/display/SPC/A111", "edit": "/pages/resumedraft.action?draftId=2686987&draftShareId=764708d1-430c-4656-abcd-8f8700e1b017", "tinyui": "/x/CwAp", "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/content/2686987" }, "_expandable": { "container": "/rest/api/space/SPC", "metadata": "", "operations": "", "children": "/rest/api/content/2686987/child", "restrictions": "/rest/api/content/2686987/restriction/byOperation", "history": "/rest/api/content/2686987/history", "ancestors": "", "body": "", "version": "", "descendants": "/rest/api/content/2686987/descendant", "space": "/rest/api/space/SPC" } } ], "start": 0, "limit": 25, "size": 4, "_links": { "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/space/SPC/content/page" } }, "blogpost": { "results": [], "start": 0, "limit": 25, "size": 0, "_links": { "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/space/SPC/content/blogpost" } }, "_links": { "base": "http://LAPTOP-HVEL9LMO:1990/confluence", "context": "/confluence" } } |
注释: |
获取页面信息
方法: | /rest/api/content/{id} |
类型 | GET |
参数: | 扩展 expand childTypes.all返回内容是否有附件、评论或子页面。如果您只需要检查内容是否具有特定类型的子项,请使用此选项。 childTypes.attachment返回内容是否有附件。 childTypes.comment返回内容是否有评论。 childTypes.page返回内容是否有子页面。 container返回内容所在的空间。这个和Get space返回的信息是一样的. metadata.currentuser返回当前用户与内容相关的信息,包括他们上次查看、修改、贡献内容或将其添加为收藏的时间。 metadata.properties返回通过 Confluence REST API 设置的内容属性。 metadata.labels返回已添加到内容中的标签。 metadata.frontend此属性仅供 Atlassian 使用。 operations返回内容的操作,在设置权限时使用。 children.page返回内容正下方级别的后代页面。 children.attachment返回内容的所有附件。 children.comment返回对内容的所有评论。 restrictions.read.restrictions.user返回有权阅读内容的用户。 restrictions.read.restrictions.group返回有权读取内容的组。请注意,这可能会返回已删除的组,因为删除组不会删除相关的限制。 restrictions.update.restrictions.user返回有权更新内容的用户。 restrictions.update.restrictions.group返回有权更新内容的组。请注意,这可能会返回已删除的组,因为删除组不会删除相关的限制。 history返回内容的历史记录,包括创建日期。 history.lastUpdated返回有关内容最近更新的信息,包括更新者和更新时间。 history.previousVersion在当前内容更新之前返回有关更新的信息。 history.contributors返回对内容做出贡献的所有用户。 history.nextVersion在当前内容更新之后返回有关更新的信息。 ancestors如果内容是页面,则返回父页面。 body返回不同格式的内容正文,包括编辑器格式、视图格式和导出格式。 body.storage以存储格式返回内容主体。 body.view以视图格式返回内容主体。 version返回有关内容最近更新的信息,包括更新者和更新时间。 descendants.page返回内容下方任何级别的后代页面。 descendants.attachment返回内容的所有附件,与children.attachment. descendants.comment返回对内容的所有评论,同children.comment. space返回内容所在的空间。这个和 Get space返回的信息是一样的. |
返回值: | 应用程序/json 内容 |
注释: expand 允许的最大子扩展是8个。 |
方法: | rest/api/content/{id}/history |
类型 | GET |
参数: | 扩展 expand lastUpdated返回有关内容最近更新的信息,包括更新者和更新时间。 previousVersion在当前内容更新之前返回有关更新的信息。对于此方法,它包含与 相同的信息lastUpdated。 contributors返回对内容做出贡献的所有用户。 nextVersion此参数不用于此方法。 |
返回值: | |
注释: |
创建新页面
方法: | /rest/api/content |
类型 | POST |
参数: | {
"title": "567", "type": "page", "space":{"id":524289,"key":"SPC"} } |
返回值: | { "id": "2686992", "type": "page", "status": "current", "title": "567", "space": { "id": 524289, "key": "SPC", "name": "智慧芽开发", "type": "global", "_links": { "webui": "/display/SPC", "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/space/SPC" }, "_expandable": { "metadata": "", "icon": "", "description": "", "homepage": "/rest/api/content/327683" } }, "history": { "latest": true, "createdBy": { "type": "known", "username": "admin", "userKey": "402885f67dd1d337017dd1d5f10a0000", "profilePicture": { "path": "/confluence/images/icons/profilepics/default.svg", "width": 48, "height": 48, "isDefault": true }, "displayName": "admin全名", "_links": { "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/user?key=402885f67dd1d337017dd1d5f10a0000" }, "_expandable": { "status": "" } }, "createdDate": "2022-02-18T16:57:41.989+08:00", "_links": { "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/content/2686992/history" }, "_expandable": { "lastUpdated": "", "previousVersion": "", "contributors": "", "nextVersion": "" } }, "version": { "by": { "type": "known", "username": "admin", "userKey": "402885f67dd1d337017dd1d5f10a0000", "profilePicture": { "path": "/confluence/images/icons/profilepics/default.svg", "width": 48, "height": 48, "isDefault": true }, "displayName": "admin全名", "_links": { "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/user?key=402885f67dd1d337017dd1d5f10a0000" }, "_expandable": { "status": "" } }, "when": "2022-02-18T16:57:41.989+08:00", "message": "", "number": 1, "minorEdit": false, "hidden": false, "_links": { "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/experimental/content/2686992/version/1" }, "_expandable": { "content": "/rest/api/content/2686992" } }, "ancestors": [], "container": { "id": 524289, "key": "SPC", "name": "智慧芽开发", "type": "global", "_links": { "webui": "/display/SPC", "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/space/SPC" }, "_expandable": { "metadata": "", "icon": "", "description": "", "homepage": "/rest/api/content/327683" } }, "body": { "storage": { "value": "", "representation": "storage", "_expandable": { "content": "/rest/api/content/2686992" } }, "_expandable": { "editor": "", "view": "", "export_view": "", "styled_view": "", "anonymous_export_view": "" } }, "extensions": { "position": "none" }, "_links": { "webui": "/display/SPC/567", "edit": "/pages/resumedraft.action?draftId=2686992", "tinyui": "/x/EAAp", "collection": "/rest/api/content", "base": "http://LAPTOP-HVEL9LMO:1990/confluence", "context": "/confluence", "self": "http://LAPTOP-HVEL9LMO:1990/confluence/rest/api/content/2686992" }, "_expandable": { "metadata": "", "operations": "", "children": "/rest/api/content/2686992/child", "restrictions": "/rest/api/content/2686992/restriction/byOperation", "descendants": "/rest/api/content/2686992/descendant" } } |
注释: |
编辑页面
方法: | /rest/api/content/{id} |
类型 | PUT |
参数: | { "version": { "number": 2 }, "title": "667788", "type": "page" } |
返回值: | |
注释: |
删除页面
方法: | /rest/api/content/{id} |
类型 | DELETE |
参数: | |
返回值: | |
注释: |
回复信息
方法: | /rest/api/content |
类型 | POST |
参数: | { "container":{ "id": 2686985 }, "title": "567", "type": "comment", "space":{"id":524289,"key":"SPC"} } |
返回值: | |
注释: 注意TYPE 传的是 comment 备注 |
附件上传
方法 | /rest/api/content/{id}/child/attachment |
类型 | PUT |
参数: | |
返回值 | |
注释: 你必须X-Atlassian-Token: nocheck在这个方法的请求上设置一个header |
附件下载
方法: | rest/api/content/{id}/child/attachment/{attachmentId}/download |
类型 | GET |
参数: | |
返回值: | 如果找到下载 URL,则返回。 |
注释: |