I would like to create tickets in an on-premise jira server. Unfortunately, no matter what i try, i get an error.
I followed the tutorial, telling me i should use curl with -u to pass user/pass information. Thats what i did:
curl -u jira.automation:78B...4RF -X GET -H "Content-Type: application/json" 'https://servicedesk.myhost.ch:8081/rest/api/2/issue/createmeta'
that returns some html, where it states: <h1>Unauthorized (401)</h1>
so i thought i try it with a token (changed the username for that)
curl -u oliver.xxx:NTk5MzY3xxxFVEbAm1 -X GET -H "Content-Type: application/json" 'https://servicedesk.myhost.ch:8081/rest/api/2/issue/createmeta'
That returned <p>Basic Authentication Failure - Reason : AUTHENTICATION_DENIED</p>
So i am wondering if this is a server thingen? Do i have to enable basic auth?
Hi @Oli
If you want to create something you will need to use POST instead of GET.
curl -u admin:admin -X POST -H "Content-Type: application/json" http://localhost:8080/jira/rest/api/2/issue/
https://docs.atlassian.com/software/jira/docs/api/REST/9.4.0/#api/2/issue-createIssue
DOes it work if you try with your credential instead the jira.automation one ?
Regards
my bad, guess i made that mistake while trying out some different things to at least get past the authentication.
i tried it with
curl -u jira.automation:thePasswordOfTheUser -X POST -H "Content-Type: application/json" 'https://servicedesk.xxx.ch:8081/rest/api/2/issue' which got me a 401
curl -u oliver.myself:NTk5MzY3O...M25WDFVEbAm1 -X POST -H "Content-Type: application/json" 'https://servicedesk.obvita.ch:8081/rest/api/2/issue' and got a 403
i changed it to a GET because i thought its maybe easier to use a regular GET on a very simple endpoint like https://servicedesk.xxx.ch:8081/rest/api/2/issue/createmeta, but also here, same behaviour
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i just visited 'https://servicedesk.xxx.ch:8081/rest/api/2' with a private browser window and noticed, that it requests me for microsoft credentials, yay, i guess the problem is that there is some kind of single sign on implemented. have to check that out with my admin and google if someone else tried to get that working. worst case would be to have like 2 logins, one for the intranet/SSO and one for jira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
so my user is not able to curl the endpoint with the token, but with my password it worked. the jira.automation user is not jira.automation but jautomation, with that it works. so it was a layer 8 communication problem ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.