Get started with Jigit GitHub/GitLab integration REST APIs
Get started with Jigit GitHub/GitLab integration REST APIs.
Basic information
URL: {JIRA_BASE_URL}/rest/jigit/1.0/configurations
Request headers:
Content-Type:
application/json
Response headers:
Content-Type:
application/json
Authentication depends on Jira configuration - Basic or Bearer.
REST endpoints do not return a token but replace it with "xxxxxxx"
Get configurations
URL: {JIRA_BASE_URL}/rest/jigit/1.0/configurations
HTTP verb: GET
Response:
[
{
"id":3,
"repoName":"test configuration",
"serverUrl":"https://github.com",
"serviceType":"GitLab",
"token":"xxxxxxx",
"repoType":"SingleRepository",
"repositoryId":"org/repository",
"defaultBranch":"master",
"branches":[
],
"enabled":true,
"requestTimeout":10000,
"sleepTimeout":10000,
"sleepRequests":100,
"branchStrategy":"ALL",
"includeSubgroups":false,
"sleepTo":0,
"smartCommitEnabled":true,
"commitsPeriod":28800000,
"commentCommitEnabled":true,
"appId":"",
"repositoryPattern":"",
"privateKey":"xxxxxxx",
"indexPullRequests":true,
"indexAllBranches":false,
"developmentEnabled":true,
"indexDaysLimit":30,
"projectKeys":[
"TEST",
"TP"
],
"devPanelOnly":false,
"level":"GLOBAL",
"supportDevelopmentPanel":true
},
....
]
Get Jira project configurations
URL: {JIRA_BASE_URL}/rest/jigit/1.0/configurations?projectKey=TEST
HTTP verb: GET
Response:
[
{
"id":3,
"repoName":"test configuration",
"serverUrl":"https://github.com",
"serviceType":"GitLab",
"token":"xxxxxxx",
"repoType":"SingleRepository",
"repositoryId":"org/repository",
"defaultBranch":"master",
"branches":[
],
"enabled":true,
"requestTimeout":10000,
"sleepTimeout":10000,
"sleepRequests":100,
"branchStrategy":"ALL",
"includeSubgroups":false,
"sleepTo":0,
"smartCommitEnabled":true,
"commitsPeriod":28800000,
"commentCommitEnabled":true,
"appId":"",
"repositoryPattern":"",
"privateKey":"xxxxxxx",
"indexPullRequests":true,
"indexAllBranches":false,
"developmentEnabled":true,
"indexDaysLimit":30,
"projectKeys":[
"TEST"
],
"devPanelOnly":false,
"projectKey": "TEST",
"level":"PROJECT",
"supportDevelopmentPanel":true
},
....
]
Get configuration by ID
URL: {JIRA_BASE_URL}/rest/jigit/1.0/configurations/{ID}
HTTP verb: GET
Response:
{
"id":3,
"repoName":"test configuration",
"serverUrl":"https://github.com",
"serviceType":"GitLab",
"token":"xxxxxxx",
"repoType":"SingleRepository",
"repositoryId":"org/repository",
"defaultBranch":"master",
"branches":[
],
"enabled":true,
"requestTimeout":10000,
"sleepTimeout":10000,
"sleepRequests":100,
"branchStrategy":"ALL",
"includeSubgroups":false,
"sleepTo":0,
"smartCommitEnabled":true,
"commitsPeriod":28800000,
"commentCommitEnabled":true,
"appId":"",
"repositoryPattern":"",
"privateKey":"xxxxxxx",
"indexPullRequests":true,
"indexAllBranches":false,
"developmentEnabled":true,
"indexDaysLimit":30,
"projectKeys":[
"TEST"
],
"devPanelOnly":false,
"projectKey": "TEST",
"level":"PROJECT",
"supportDevelopmentPanel":true
}
Save configuration
URL: {JIRA_BASE_URL}/rest/jigit/1.0/configurations
HTTP verb: POST
Payload:
{
"repoName":"test configuration",
"serverUrl":"https://github.com",
"serviceType":"GitLab", //GitLab, GitLab8, GitHub, GitHubApp
"token":"MY_TOKEN",
"repoType":"SingleRepository", //SingleRepository, GroupOfRepositories
"repositoryId":"org/repository",
"defaultBranch":"master",
"branches":[
"dev"
],
"enabled":true,
"requestTimeout":10000, //ms
"sleepTimeout":10000, //ms
"sleepRequests":100, //count
"branchStrategy":"ALL", //ALL, MASK, SELECTED
"includeSubgroups":false,
"sleepTo":0, // internal usage only
"smartCommitEnabled":true,
"commitsPeriod":28800000, // days in ms
"commentCommitEnabled":true,
"appId":"",
"repositoryPattern":"",
"privateKey":null,
"indexPullRequests":true,
"indexAllBranches":false,
"developmentEnabled":true,
"indexDaysLimit":30,
"projectKeys":[
"TEST"
],
"devPanelOnly":false,
"projectKey": null, //must be set only if level=PROJECT
"level":"GLOBAL", // GLOBAL, PROJECT
"supportDevelopmentPanel":true
}
Response:
{
"id":3,
"repoName":"test configuration",
"serverUrl":"https://github.com",
"serviceType":"GitLab",
"token":"xxxxxxx",
"repoType":"SingleRepository",
"repositoryId":"org/repository",
"defaultBranch":"master",
"branches":[
"dev"
],
"enabled":true,
"requestTimeout":10000,
"sleepTimeout":10000,
"sleepRequests":100,
"branchStrategy":"ALL",
"includeSubgroups":false,
"sleepTo":0,
"smartCommitEnabled":true,
"commitsPeriod":28800000,
"commentCommitEnabled":true,
"appId":"",
"repositoryPattern":"",
"privateKey":null,
"indexPullRequests":true,
"indexAllBranches":false,
"developmentEnabled":true,
"indexDaysLimit":30,
"projectKeys":[
"TEST"
],
"devPanelOnly":false,
"level":"GLOBAL",
"supportDevelopmentPanel":true
}
Update configuration
URL: {JIRA_BASE_URL}/rest/jigit/1.0/configurations/{ID}
HTTP verb: PUT
Payload:
{
"repoName":"test configuration",
"serverUrl":"https://github.com",
"serviceType":"GitLab",
"token":"xxxxxxx",
"repoType":"SingleRepository",
"repositoryId":"org/repository",
"defaultBranch":"master",
"branches":[
],
"enabled":true,
"requestTimeout":10000,
"sleepTimeout":10000,
"sleepRequests":100,
"branchStrategy":"ALL",
"includeSubgroups":false,
"sleepTo":0,
"smartCommitEnabled":true,
"commitsPeriod":28800000,
"commentCommitEnabled":true,
"appId":"",
"repositoryPattern":"",
"privateKey":"xxxxxxx",
"indexPullRequests":true,
"indexAllBranches":false,
"developmentEnabled":true,
"indexDaysLimit":30,
"projectKeys":[
"TEST"
],
"devPanelOnly":false,
"projectKey": "TEST",
"level":"PROJECT",
"supportDevelopmentPanel":true
}
Response:
{
"id":3,
"repoName":"test configuration",
"serverUrl":"https://github.com",
"serviceType":"GitLab",
"token":"xxxxxxx",
"repoType":"SingleRepository",
"repositoryId":"org/repository",
"defaultBranch":"master",
"branches":[
],
"enabled":true,
"requestTimeout":10000,
"sleepTimeout":10000,
"sleepRequests":100,
"branchStrategy":"ALL",
"includeSubgroups":false,
"sleepTo":0,
"smartCommitEnabled":true,
"commitsPeriod":28800000,
"commentCommitEnabled":true,
"appId":"",
"repositoryPattern":"",
"privateKey":"xxxxxxx",
"indexPullRequests":true,
"indexAllBranches":false,
"developmentEnabled":true,
"indexDaysLimit":30,
"projectKeys":[
"TEST"
],
"devPanelOnly":false,
"projectKey": "TEST",
"level":"PROJECT",
"supportDevelopmentPanel":true
}
Delete configuration
URL: {JIRA_BASE_URL}/rest/jigit/1.0/configurations/{ID}
HTTP verb: DELETE
Response:
{
"id":3,
"repoName":"test configuration",
"serverUrl":"https://github.com",
"serviceType":"GitLab",
"token":"xxxxxxx",
"repoType":"SingleRepository",
"repositoryId":"org/repository",
"defaultBranch":"master",
"branches":[
],
"enabled":true,
"requestTimeout":10000,
"sleepTimeout":10000,
"sleepRequests":100,
"branchStrategy":"ALL",
"includeSubgroups":false,
"sleepTo":0,
"smartCommitEnabled":true,
"commitsPeriod":28800000,
"commentCommitEnabled":true,
"appId":"",
"repositoryPattern":"",
"privateKey":"xxxxxxx",
"indexPullRequests":true,
"indexAllBranches":false,
"developmentEnabled":true,
"indexDaysLimit":30,
"projectKeys":[
"TEST"
],
"devPanelOnly":false,
"projectKey": "TEST",
"level":"PROJECT",
"supportDevelopmentPanel":true
}
Disable/Enable configuration
URL: {JIRA_BASE_URL}/rest/jigit/1.0/configurations/{ID}/activity?enabled=false
HTTP verb: PUT
Response:
{
"id": 3,
"repoName":"test configuration",
"serverUrl":"https://github.com",
"serviceType":"GitLab",
"token":"xxxxxxx",
"repoType":"SingleRepository",
"repositoryId":"org/repository",
"defaultBranch":"master",
"branches":[
],
"enabled":true,
"requestTimeout":10000,
"sleepTimeout":10000,
"sleepRequests":100,
"branchStrategy":"ALL",
"includeSubgroups":false,
"sleepTo":0,
"smartCommitEnabled":true,
"commitsPeriod":28800000,
"commentCommitEnabled":true,
"appId":"",
"repositoryPattern":"",
"privateKey":"xxxxxxx",
"indexPullRequests":true,
"indexAllBranches":false,
"developmentEnabled":true,
"indexDaysLimit":30,
"projectKeys":[
"TEST"
],
"devPanelOnly":false,
"projectKey": "TEST",
"level":"PROJECT",
"supportDevelopmentPanel":true
}
Change authentication credentials
URL: {JIRA_BASE_URL}/rest/jigit/1.0/configurations/{ID}/authentication
HTTP verb: PUT
Payload:
{
"token": "NEW_TOKEN" // optional,
"privateKey": "NEW_PRIVATE_KEY" // only for GitHub App
"appId": "app_id" // only for GitHub App
}
Response:
{
"id": 3,
"repoName":"test configuration",
"serverUrl":"https://github.com",
"serviceType":"GitLab",
"token":"xxxxxxx",
"repoType":"SingleRepository",
"repositoryId":"org/repository",
"defaultBranch":"master",
"branches":[
],
"enabled":true,
"requestTimeout":10000,
"sleepTimeout":10000,
"sleepRequests":100,
"branchStrategy":"ALL",
"includeSubgroups":false,
"sleepTo":0,
"smartCommitEnabled":true,
"commitsPeriod":28800000,
"commentCommitEnabled":true,
"appId":"",
"repositoryPattern":"",
"privateKey":"xxxxxxx",
"indexPullRequests":true,
"indexAllBranches":false,
"developmentEnabled":true,
"indexDaysLimit":30,
"projectKeys":[
"TEST"
],
"devPanelOnly":false,
"projectKey": "TEST",
"level":"PROJECT",
"supportDevelopmentPanel":true
}
Updated: