Scm Activity REST API Interface or CLI (Legacy)
GET CHANGE-SETS BY ISSUE KEY
GET http://localhost:8080/rest/scmactivity/1.0/changeset/activity/{issueKey}
Query Parameters:
- issueKey (String) - JIRA Issue Key e.g. DT-45
Response: [Status: 200]
$ curl -s -u "user:passwd" -XGET \ http://localhost:8080/rest/scmactivity/1.0/changeset/activity/DT-45
GET FIRST OR LAST CHANGE-SET BY ISSUE KEY
GET http://localhost:8080/rest/scmactivity/1.0/changeset/activity/{issueKey}/first
GET http://localhost:8080/rest/scmactivity/1.0/changeset/activity/{issueKey}/last
Query Parameters:
- issueKey (String) - JIRA Issue Key e.g. DT-45
Response: [Status: 200]
$ curl -s -u "user:passwd" -XGET \ http://localhost:8080/rest/scmactivity/1.0/changeset/activity/DT-45/last
GET CHANGE-SET ACTIVITY BY CHANGE TYPE, ISSUE KEY, AND CHANGE ID
GET http://localhost:8080/rest/scmactivity/1.0/changeset/activity/{changeType}/{issueKey}/{changeId}
Query Parameters:
- changeType (String) - SCM Change-set Type e.g. perforce
- issueKey (String) - JIRA Issue Key e.g. DT-45
- changeId (String) - SCM Change-set ID
Response: [Status: 200]
$ curl -s -u "user:passwd" -XGET \ http://localhost:8080/rest/scmactivity/1.0/changeset/activity/perforce/DT-45/100
ADD OR POST NEW SCM ACTIVITY
POST http://localhost:8080/rest/scmactivity/1.0/changeset/activity
Required Schema Field(s):
- issueKey
- changeId
- changeType
- changeAuthor
- changeDate
Response: [Status: 200]
$ curl -s -u "user:passwd" -XPOST -H "Content-Type: application/json" --data '{"issueKey":\ "DT-45","changeId":"100","changeType":"perforce","changeDate":"2016-05-01 00:00:00",\ "changeStatus":"submitted","changeAuthor":"john","changeLink":"http://perforceweb/c=100",\ "changeMessage":"Fixed bug for software X DT-45","changeFiles":[{"fileName":\ "/depot/src/AppEntityManager.java","fileAction":"Modified","fileVersion":"23"}]}' \ http://localhost:8080/rest/scmactivity/1.0/changeset/activity {"result":1,"message":"[Info] DT-45 > 100 activity row [1] is added."} $
Schema:
{ "issueKey": { "type": "string" }, "changeId": { "type": "string" }, "changeType": { //Preferred format: ChangeType_Repo/Instance Name e.g. p4_engsw "type": "string" }, "changeAuthor": { "type": "string" }, "changeDate": { //UTC date time with format %Y-%m-%d %H:%M:%S "type": "string" }, "changeBranch": { "type": "string" }, "changeTag": { "type": "string" }, "changeStatus": { "type": "string" }, "changeLink": { "type": "string" }, "changeMessage": { "type": "string" }, "changeFiles": { "type": "List" }, "changeUpdate": { "type": "boolean" }, "notifyEmail": { "type": "boolean" }, "notifyAs": { "type": "string" } }
UPDATE SCM ACTIVITY MESSAGE
POST http://localhost:8080/rest/scmactivity/1.0/changeset/activity/message
Required Schema Field(s):
- issueKey
- changeId
- changeType
- changeMessage
Response: [Status: 200]
$ curl -s -u "user:passwd" -XPOST -H "Content-Type: application/json" --data '{"issueKey":\ "SD-1","changeId":"100","changeType":"perforce","changeMessage":\ "Fixed bug for software X. jira:SD-1"}' \ http://localhost:8080/rest/scmactivity/1.0/changeset/activity/message {"result":1,"message":"[Info] SD-1 > 100 activity message row [1] is updated."} $
Schema:
{ "issueKey": { "type": "string" }, "changeId": { "type": "string" }, "changeType": { "type": "string" }, "changeMessage": { "type": "string" } }
UPDATE SCM ACTIVITY AFFECTED/CHANGE FILES
POST http://localhost:8080/rest/scmactivity/1.0/changeset/activity/files
Required Schema Field(s):
- issueKey
- changeId
- changeType
- changeFiles
Response: [Status: 200]
$ curl -s -u "user:passwd" -XPOST -H "Content-Type: application/json" --data '{"issueKey":\ "DT-45","changeId":"100","changeType":"perforce","changeFiles":[{"fileName":\ "/depot/src/AppEntityManager.java","fileAction":"Modified","fileVersion":"23"},{"fileName":\ "/depot/src/Test.java","fileAction":"Added","fileVersion":"1"}]}' \ http://localhost:8080/rest/scmactivity/1.0/changeset/activity/files {"result":1,"message":"[Info] DT-45 > 100 activity change files row [1] is updated."} $
Schema:
{ "issueKey": { "type": "string" }, "changeId": { "type": "string" }, "changeType": { "type": "string" }, "changeFiles": { "type": "List" } }
Change Files List Item:
{ "fileName" : { "type": "String" }, "fileAction" : { "type": "String" }, "fileVersion" : { //Optional "type": "String" } }
POST EXTERNAL JOB LINK
POST http://localhost:8080/rest/scmactivity/1.0/changeset/joblink
Required Schema Field(s):
- issueKey
- changeId
- changeType
- jobName
- jobStatus
- jobLink
Response: [Status: 200]
$ curl -s -u "user:passwd" -XPOST -H "Content-Type: application/json" --data '{"issueKey":\ "SD-1","changeId":"100","changeType":"perforce","jobName":"test-build#140","jobStatus":"SUCCESS",\ "jobLink":"http://jenkins/job/test-build/140"}' \ http://localhost:8080/rest/scmactivity/1.0/changeset/joblink {"result":1,"message":"[Info] SD-1 > 100 > test-build#140 joblink is added."} $
Schema:
{ "issueKey": { "type": "string" }, "changeId": { "type": "string" }, "changeType": { "type": "string" }, "jobName": { //Unique "type": "string" }, "jobStatus": { "type": "string" }, "jobLink": { "type": "string" }, "jobUpdate": { "type": "boolean" }, "notifyEmail": { "type": "boolean" }, "notifyAs": { "type": "string" } }
DELETE SCM ACTIVITY BY CHANGE TYPE, ISSUE KEY AND CHANGE ID
DELETE http://localhost:8080/rest/scmactivity/1.0/changeset/activity/unset/by/{changeType}/{issueKey}/{changeId}
Query Parameters:
- changeType (String) - SCM Change-set Type e.g. perforce
- issueKey (String) - JIRA Issue Key e.g. DT-45
- changeId (String) - SCM Change-set ID
Response: [Status: 204]
DELETE SCM ACTIVITY AFFECTED FILE BY CHANGE TYPE, ISSUE KEY, CHANGE ID AND FILE ID
Query Parameters:
- changeType (String) - SCM Change-set Type e.g. perforce
- issueKey (String) - JIRA Issue Key e.g. DT-45
- changeId (String) - SCM Change-set ID
- fileId (Integer) - File ID e.g. 18
Response: [Status: 204]
DELETE JOB LINK BY CHANGE TYPE, ISSUE KEY, CHANGE ID AND JOB ID
Query Parameters:
- changeType (String) - SCM Change-set Type e.g. perforce
- issueKey (String) - JIRA Issue Key e.g. DT-45
- changeId (String) - SCM Change-set ID
- jobId (Integer) - Job ID e.g. 18
Response: [Status: 204]