Hi,
We are trying to migrate into Jira Cloud and, as part of this, I need to build an integration to push Commit information from our on-premise source control to Jira Cloud.
To do this, I have tried to follow the instructions to create an OAuth token Integrating Jira Software Cloud with on-premises tools
So I’ve gone to “Settings > Apps > Manage Apps > OAuth credentials” and created an id / secret.
Now I’m sending:
POST https://api.atlassian.com/oauth/token
{
"audience": "api.atlassian.com",
"grant_type":"client_credentials",
"client_id": "...",
"client_secret": "..."
}
This is successfully returning a token.
{
"access_token": "...",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "manage:jira-data-provider"
}
I am now trying to call the “/rest/devinfo/0.10/bulk” endpoint https://developer.atlassian.com/cloud/jira/software/rest/api-group-development-information/#api-group-development-information
My request (which is somewhat made up to test that it works) looks like:
POST https://<oursite>.atlassian.net/rest/devinfo/0.10/bulk
{
"repositories": [
{
"id": "AZDO",
"name": "Azure DevOps",
"url": "...",
"updateSequenceId": 638399974784049370,
"commits": [
{
"id": "92117",
"displayId": "92117",
"url": ".../_VersionControl/changeset/92117",
"issueKeys": [
"SROAD-10"
],
"message": "SROAD-10: Fix compiler error",
"author": {
"email": "..."
},
"fileCount": 1,
"authorTimestamp": "2024-01-04T20:37:58",
"updateSequenceId": 638399974784929813
}
]
}
]
}
Headers are:
Authorization
:Bearer <token>
Accept
:application/json
Content-Type
:application/json
When I do this, I just get back:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<status>
<status-code>401</status-code>
<message>Client must be authenticated to access this resource.</message>
</status>
(note also so not sure why it returned XML…)
I am unsure how I can diagnose why it isn’t working or how I would fix it.
Any help would be greatly appreciated!
Cheers,
Chris