I can see from various posts, there is much discussion around Rest API with Powershell and the format of logging in. Originally we had the authorisation set to basic, but from reading a post from April 19, you can no longer use this and have to used basic_auth, along with your username and a tokencode.
When running the script below it does not give any errors, but also does not return any results, but if I was to put the url into a browser, it returns the results, any ideas?. I have remove specific detail form the script
#Set Login
$Jheader = @{
basic_auth=('username here', 'tokencode here')
}
#Get projects from Jira
$projects = Invoke-RestMethod -Method Get -Uri "https://MYINSTANCENAMEHERE/rest/api/2/project?expand=issueTypes" -Headers $Jheader -ContentType "application/json"
Hi @Jonathan Gilbert ,
Can you kindly check:
curl -D- -u xxxxxxx@atlassian.com:xxxxxxxxxxxxx -H "Accept: application/json" -H "Content-Type: application/json" -X GET https://xxxxxxx.atlassian.net/rest/api/2/project?expand=issueTypes
HTTP/2 200
server: AtlassianProxy/1.15.8.1
vary: Accept-Encoding
[removed]
....
[{"expand":"description,lead,issueTypes,url,projectKeys,permissions","self":"https://xxxxxxxx.atlassian.net/rest/api/2/project/10301","id":"10301",.........
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.