Scm Changesets Activity Cloud App REST API Interface or CLI

Configure Security Token

Go to Jira Settings > Apps > Configure SCM Changesets > Custom Tab.

Set security token and copy REST Endpoint URL.

 

Add New SCM Activity

POST https://scmchangesets.ilaesolution.com/scmchangesets/custom/push?clientKey=fd4a2eba-7864-3304-8292-****&securityToken=0123***

Required Schema Field(s):

  • issueKey

  • changeId

  • changeType

  • changeAuthor

  • changeDate

Response: [Status: 200]

1 2 3 4 5 6 7 8 $ curl -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"}]}' \ "https://scmchangesets.ilaesolution.com/scmchangesets/custom/push?clientKey=fd4a2eba-7864-3304-8292-****&securityToken=0123***" {"result":1,"message":"[Info] DT-45 > 100 activity row [1] is added."} $


SCM Activity Schema:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 { "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" }, "changeTagLink": { "type": "string" }, "changeStatus": { "type": "string" }, "changeLink": { "type": "string" }, "changeMessage": { "type": "string" }, "changeFiles": { "type": "List" }, "changeUpdate": { "type": "boolean" } }


SCM Change Files Schema:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "fileName" : { "type": "String" }, "fileAction" : { "type": "String" }, "fileVersion" : { //Optional "type": "String" }, "fileLink" : { "type": "String" } }

 

Scripts:

https://ilaesolution.atlassian.net/wiki/spaces/SA/pages/23789649

 

Delete SCM ChangeSet

https://scmchangesets.ilaesolution.com/scmchangesets/custom/push?clientKey=c5765cc3-952b-3d97-8ed7-*****&securityToken=*****&issueKey=DT-2&changeId=d533b18b1e6a8bb2a60e980eaba395002bd92&changeType=Bitbucket/***/***

1 2 3 4 5 $ curl -XDELETE "https://scmchangesets.ilaesolution.com/scmchangesets/custom/push?clientKey= c5765cc3-952b-3d97-8ed7-*****&securityToken=*****&issueKey=DT-2&changeId= d533b18b1e6a8bb2a60e980eaba395002bd92&changeType=Bitbucket/***/***" {"message":"[Info] DT-2 > d533b18b1e6 > type [Bitbucket/***/***] is deleted.","id":0} $