createProject rpc call failing

I am trying to call rpc/createProject with a request body of required parameters and it is failing with a response of errorcode: 100 and message: Cannot deserialize params. Method: 'createProject', params: '{.......(all params here)...

My request message: 

{
"newProjectId": "eldnk",
"settings": {
"projectName": "Elnk",
"vcsSettings": {
"mappings": [{
"id": "id",
"vcs": "svn",
"url": "http://..valid url...",
"username": "username", (non Base64 encoded)
"password": "passwd" (non Base64 encoded)
}]
},
"checkIntervalSeconds": "300",
"projectModel": {
"type": "none"

},
"codeReviewIdPattern": "ELD-CR-{}",
"issueTrackerProviderSettings": {
"providerKey": "JIRA",
"settings": {
"serverURL": "http://validjiraurl",
"projectKey": "ECP",
"login": "login", (non Base64 encoded)
"password": "password" (non Base64 encoded)
}
}
}
}

3 comments
Comment actions Permalink

Try the folliwng one:

{"newProjectId":"test-project",
"settings":
{
"projectName":"test-projects",
"projectModel":{"type":"none"},
"codeReviewIdPattern":"ID-CR-{}",
"runInspections":true,
"mavenSettings":"",
"mavenProfiles":"",
"createUserGroups":true,
"defaultEncoding":"",
"defaultBranch":"trunk",
"skipFileContentsImport":["*.bin","*.dll","*.exe","*.so"],
"vcsSettings":
"{\"mappings\":[{\"vcs\":\"svn\",\"url\":\"https://svn_repo/\",\"authMethod\":\"Password\",\"login\":\"svn_admin\",\"password\":\"some_password\",\"mapping\":\"\",\"client\":\"\",\"svnBranches\":\"branches/\",\"id\":\"projectId\"}]}"
}
}

1
Comment actions Permalink

Thanks dude, that worked great. Can you please provide how do I enable issueTracker in this? I am using JIRA using password authentication mode.

0
Comment actions Permalink

Hey,

There is a trick, that should help you to get answers to most questions regarding Upsource API:

You might always see the exact request that is done by Upsource UI in the browser's Network log. How to do that:

  • Enable dev console in Chrome
  • Refresh Upsource page
  • Go to Netwrok > ws
  • Create project manually in Upsource UI
  • Click on the record under "Name" tab
  • in the right pane go to frames and find there createProject request

The request will contain the exact json that was sent to the backend.

1

Please sign in to leave a comment.